From: John B. <joh...@ne...> - 2000-07-27 10:21:45
|
> Net::LDAP already does this to some extent. But I think one of the big > startup costs is that Convert::ASN1 must parse the ASN.1 for the protocol. > > gbarr@chipper:~/src/ldap > time perl -Ilib -e0 > perl -Ilib -e0 0.00s user 0.00s system 0% cpu 0.000 total > > gbarr@chipper:~/src/ldap > time perl -Ilib -MNet::LDAP -e0 > perl -Ilib -MNet::LDAP -e0 0.38s user 0.00s system 64% cpu 0.593 total > > gbarr@chipper:~/src/ldap > time perl -Ilib -MNet::LDAP::ASN -e0 > perl -Ilib -MNet::LDAP::ASN -e0 0.25s user 0.00s system 32% cpu 0.763 total > > As you can see it is a large % of the load time. > > It should be possible to just parse this on install and dump it to a file. Thats interesting, because it hints that XSing Convert::ASN1 might not help as much as might be expected (is parsing much quicker in C than perl?). Would a reasonable approach to be to have 'compile' and 'decompile' methods in Convert::ASN1 which convert between 'readable' :-) ASN.1 and something nearer the internal representation? Then, as you say, do a 'compile' on install or first run and save the results? (I guess there isn't a sensible place to keep an on-disk cache of compiled ASN1 definitions). jb |