Re: commit -- Working STL vector support


Subject: Re: commit -- Working STL vector support
From: Randy Kramer (rhkramer@fast.net)
Date: Mon Dec 18 2000 - 21:25:39 CST


Thomas Fletcher wrote:
>
> On Mon, 18 Dec 2000, Dom Lachowicz wrote:
>
> > Thomas wrote:

> Now here are my results:
>
> Initial test with original vector class:
> System runs @ 350847 cycles/sec
> Running 10 loops of 50000 iterations
> 1067721053 cycles 3043.27 ms
> 1065270144 cycles 3036.28 ms
> 1064068227 cycles 3032.86 ms
> 1062944582 cycles 3029.65 ms
> 1062888058 cycles 3029.49 ms
> 1062475271 cycles 3028.32 ms
> 1063600104 cycles 3031.52 ms
> 1064628594 cycles 3034.45 ms
> 1063410321 cycles 3030.98 ms
> 1063126250 cycles 3030.17 ms
>
> Then I went into the vector class and re-wrote the array growing code
> to use realloc() instead of malloc free and at the same time got
> rid of a function call that was being used in one location to
> determine how much to grow the array. Re-running the tests I got:
>
> Running with my two simple optimizations:
> System runs @ 350847 cycles/sec
> Running 10 loops of 50000 iterations
> 10830486 cycles 30.87 ms
> 10029181 cycles 28.59 ms
> 9580695 cycles 27.31 ms
> 9345701 cycles 26.64 ms
> 9486645 cycles 27.04 ms
> 10394098 cycles 29.63 ms
> 11091530 cycles 31.61 ms
> 9466747 cycles 26.98 ms
> 9293571 cycles 26.49 ms
> 9280968 cycles 26.45 ms
>
> Not bad for a couple lines of code tweaking ... a factor of ten
> on this large list.

I guess that's the large, economy size factor of ten? ;-)



This archive was generated by hypermail 2b25 : Mon Dec 18 2000 - 21:25:32 CST