Home » Developing U++ » U++ Developers corner » Experiments with Vector growth factor...
Experiments with Vector growth factor... [message #7263] |
Tue, 19 December 2006 21:41 |
|
mirek
Messages: 14039 Registered: November 2005
|
Ultimate Member |
|
|
Well, most current STL implementations now use 1.5 instead of 2; U++ is using 2 (this is how vector grows capacity when it does not contain enough elements).
Today I did some experiments (using idmap benchmark) with other grow factors. Lower factor should lead to slower code but less memory wasted.
This is what I get (in idmap benchmark):
Minimal grow - 50167 bytes used
Factor 4/3, 52195 bytes used, 3157 ms execution time
Factor 3/2, 54095 bytes, 3062 ms execution
Factor 2, 56115 bytes, 2968 ms execution
Not sure what to take from this
Note: original reasons to adopt 1.5 grow factor in STL (it was suggested by Andrew Koenig's analysis) are related to classic heap allocator and do not apply to U++....
Mirek
[Updated on: Tue, 19 December 2006 21:41] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Sep 21 03:26:25 CEST 2024
Total time taken to generate the page: 0.02222 seconds
|