Boost logo

Boost Users :

From: bert hubert (bert.hubert_at_[hidden])
Date: 2006-03-12 16:55:42


On Sun, Mar 12, 2006 at 04:52:34PM +0100, JOAQUIN_LOPEZ_MU?Z wrote:

> So, the prunning code goes like:
>
> /* 1 */
> for(j=ttdindex.begin();j!=ttdindex.end();){
> // leave to-be-pruned elements at the beginning
> // of ttdindex
> }
>
> /* 2 */
> ttdindex.erase(ttdindex.begin(), j);

I've timed it separately, /* 1 */ is 'walk took', /* 2 */ is 'erase took'.
It appears both are more or less related, but that /* 2 */ dominates the
stats.

The number of items deleted is looked - partial, where partial is the number
of records that were partially pruned and begat a higher ttd because of
the operation. So /* 1 */ is more than leaving elements behind, it also
kicks some elements upwards.

The list below gets interesting near the end.

Walk took 183usec
Erase took 838 usec, looked: 166, quick: 101, full: 53, partial: 12, no: 0
Walk took 227usec
Erase took 1793 usec, looked: 228, quick: 145, full: 66, partial: 17, no: 0
Walk took 175usec
Erase took 1031 usec, looked: 199, quick: 116, full: 75, partial: 8, no: 0
Walk took 218usec
Erase took 1316 usec, looked: 197, quick: 116, full: 67, partial: 14, no: 0
Walk took 181usec
Erase took 1569 usec, looked: 202, quick: 126, full: 64, partial: 12, no: 0
Walk took 228usec
Erase took 1405 usec, looked: 188, quick: 109, full: 63, partial: 16, no: 0
Walk took 182usec
Erase took 1424 usec, looked: 192, quick: 128, full: 54, partial: 10, no: 0
Walk took 389usec
Erase took 6870 usec, looked: 520, quick: 361, full: 143, partial: 16, no: 0
Walk took 287usec
Erase took 6294 usec, looked: 473, quick: 344, full: 121, partial: 8, no: 0
Walk took 338usec
Erase took 7356 usec, looked: 541, quick: 413, full: 120, partial: 8, no: 0
Walk took 349usec
Erase took 5000 usec, looked: 403, quick: 272, full: 115, partial: 16, no: 0
Walk took 353usec
Erase took 4873 usec, looked: 410, quick: 288, full: 103, partial: 19, no: 0
Walk took 355usec
Erase took 6346 usec, looked: 450, quick: 330, full: 103, partial: 17, no: 0
Walk took 324usec
Erase took 6318 usec, looked: 494, quick: 377, full: 103, partial: 14, no: 0
Walk took 389usec
Erase took 6535 usec, looked: 463, quick: 339, full: 107, partial: 17, no: 0
Walk took 256usec
Erase took 4742 usec, looked: 401, quick: 302, full: 90, partial: 9, no: 0
Walk took 187usec
Erase took 1878 usec, looked: 214, quick: 151, full: 51, partial: 12, no: 0
Walk took 196usec
Erase took 1501 usec, looked: 213, quick: 143, full: 56, partial: 14, no: 0
Walk took 491usec
Erase took 7775 usec, looked: 601, quick: 412, full: 171, partial: 18, no: 0
Walk took 533usec
Erase took 9407 usec, looked: 427, quick: 328, full: 89, partial: 10, no: 0
Walk took 2400usec
Erase took 49265 usec, looked: 838, quick: 586, full: 232, partial: 20, no: 0
Walk took 2511usec
Erase took 56049 usec, looked: 807, quick: 620, full: 175, partial: 12, no: 0
Walk took 4478usec
Erase took 87982 usec, looked: 1699, quick: 1274, full: 372, partial: 53, no: 0

I'll try to graph this behaviour a bit.

Thanks!

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://netherlabs.nl              Open and Closed source services

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net