directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan D. Cabrera" <...@toolazydogs.com>
Subject Re: [asn1] why use TLV objects at all?
Date Thu, 24 Feb 2005 04:46:27 GMT


Alex Karasulu wrote:

> Emmanuel,
>
> I was just thinking about your position on object creation.  Namely 
> the one that is against the creation of Tuple objects that represent 
> TLVs.  Your proposal to use pooling of these objects worries me a 
> bit.  It just makes me think there would be a lot of synchronization 
> overhead.  I may be wrong.

I was also concerned by this as it may require that you keep a rough 
factor of 2 more memory, one for the Tuple structure of the message and 
one for the POJO that you are creating.

> However I started thinking, "why create Tuples at all?" Follow my 
> concepts here for a sec even though we have not been discussiong these 
> constructs: TupleProducers and TupleConsumers.  A producer simply 
> emits callbacks to a consumer and they are bound to each other.  What 
> if the callbacks did not pass in a Tuple as an argument but the 
> components T, L and V of the Tuple instead.  A stub, which is like the 
> parser you mentioned, tracks and changes state as an automaton to 
> populate its properties appropriately with the stream of Tuple 
> events.  The stub can be a TupleConsumer - really a tuple event 
> consumer rather.  This would eliminate object creation overheads and 
> populate the stub. 

Could you not flatten it even further by making a compiler generated 
stub act as both the producer and consumer?  This is the tack that I am 
taking with my "smart" stubs.


Regards,
Alan



Mime
View raw message