help-libtasn1
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cleanup _asn1_copy_structure3


From: Simon Josefsson
Subject: Re: [PATCH] cleanup _asn1_copy_structure3
Date: Mon, 10 Sep 2012 09:24:36 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.3 (gnu/linux)

Nikos Mavrogiannopoulos <address@hidden> writes:

> On Fri, Sep 7, 2012 at 4:29 PM, Nikos Mavrogiannopoulos <address@hidden> 
> wrote:
>
>> Btw. I noticed that samba's talloc has a talloc using a pool. Using
>> that in libtasn1 could have the following immediate effects:
>> * No memory leaks once a structure is deallocated
>> * A single malloc (or at least fewer) per structure
>> In general talloc() should be a bit slower than plain malloc, but I
>> believe that pooled version could have an impact in this case. I'll
>> try to test it this or next weekend.
>
> It seems that talloc either with pools or not is much slower than the
> current code. However, a quick optimization that reduced that
> allocations by almost a third (2000 allocations for a certificate
> instead of 3000), is to make the node name a fixed string. This also
> increased the performance of the library in decoding by almost 20%.
> However, I've noticed that for some reason the node_asn structure is
> exported in libtasn1.h, something that doesn't prevents to make this
> change (at least directly). This is quite surprizing as this structure
> was definitely not intended to be exported. Given that this node_asn
> isn't documented anywhere, are there actually any projects using it?
> If yes, why is that - can we emulate the use case with a new function?
> I think future versions of libtasn1 should drop this structure from
> the exported API to allow the library to be rewritten and keep the
> same API.

I agree -- and considered doing this when we did the 'small_value' (see
int.h) change that we did earlier.  However, I think actually GnuTLS was
one consumer of the node_asn_struct...  I think it was only in some
X.509 Name functions contributed by Howard Chu, so perhaps we can
rewrite only those parts.

With that fixed, I think we could roll a libtasn1 3.x branch that
removed the struct, and move on from there...  that would allow a
rewrite of the internal tree stuff without breaking API/ABI.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]