directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: [ADS 2.0] New ASN.1 codec metrics
Date Sat, 09 Sep 2006 13:27:59 GMT
Ersin Er a écrit :

> Hi,
>
> On 9/9/06, Emmanuel Lecharny <elecharny@iktek.com> wrote:
>
>> <sqnip/>
>> - Twix : encoding 10 000 000 BindRequest takes 27 seconds
>> - NewTwix : encoding 10 000 000 BindRequest takes 192 seconds 
>
> <snip/>

>> Question : at what point good design is better than performance ?
>
>
> Good design is good and it can be optimized I think. Don't you think
> that there may be some optimization points in the new code?

Yes, for sure. For isntance, the measure was done in Debug mode ... Not 
very good, indeed :)
Now, here are the real values :
- Twix : encoding 10 000 000 BindRequest takes 27 seconds
- NewTwix : encoding 10 000 000 BindRequest takes 64 seconds

This is only ~2.4 times slower. The overcost is mainly due to the 
creation of Decorators and Ber instance of decorators. Without those 
object creations, we would have been as fast.

Ok, now, let's discuss that a little bit. We need decorators, because it 
helps a lot to decouple the data and the logic. We should use them if we 
deliver an API which will be used by client. On the server side, I'm a 
little bit reluctant to use something that cost 2.4 times, when this 
portion of code is so heavily used. But, right now, we can live with 
this result.

We should just keep in mind that there is a margin if we really need to 
improve things :)

If anybody has a better idea than Decorators to design the codec, I will 
be very happy to hear about it. The current design can be seen here :
http://docs.safehaus.org/display/APACHEDS/Message+structure

Emmanuel.
PS: Thanks Ersin to have mentioned a potential optimization :)

>
>> Emmanuel Lécharny
>
>


Mime
View raw message