[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: binary entry read/write



> -----Original Message-----
> From: Kurt D. Zeilenga [mailto:Kurt@OpenLDAP.org]

> At 12:26 PM 2001-10-19, Howard Chu wrote:
> >I've just committed some patches for back-bdb that use my new
> encode/decode
> >routines. These use around 1/10th the CPU time of the BER-based
> encoder. In
> >a profile of adding 1205 entries to an empty database, slapd calls
> >ber_memalloc  113172 times. Using the BER encoder it's 412183 times.
> >Performing 4 searches for all of those entries yields 1357115
> memalloc's for
> >BER-based, and only 275025 for my encoder.
>
> How much of the savings is due to caching AttributeDescriptions?

I was able to do another set of runs separating the adds from the searches.
By the way, the largest percentage of add's CPU time is in idl_check, which
I
guess we can discount since that's for debug only.

Adding 1205 entries (1265 attempts, 60 duplicates that were rejected)
ber_encode/ber_decode              bin_encode/bin_decode
calls  func                vs      calls  func
408491 ber_memalloc                112724 ber_memalloc
140839 ch_malloc                    34086 ch_malloc
 19301 slap_bv2ad                    4076 slap_bv2ad
                                    15245 bdb_str2ad
The calls to slap_bv2ad account for
 57903 ch_malloc invocations        12228 ch_mallocs

Searching for those 1205 entries, 4 times in a row
714044 ber_memalloc                 47774 ber_memalloc
262056 ch_malloc                    14696 ch_malloc
 34687 slap_bv2ad                      49 slap_bv2ad
                                    34660 bdb_str2ad

The calls to slap_bv2ad account for
104061 ch_malloc invocations          147 ch_mallocs

If you'd like the gprof output files I can email them.
  -- Howard