Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 is currently offline  mirek
Messages: 13984
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 Wink

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

 
Read Message
Previous Topic: U++ as web platform
Next Topic: Critical feature - namespace
Goto Forum:
  


Current Time: Mon Jun 10 01:07:31 CEST 2024

Total time taken to generate the page: 0.03430 seconds