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 » U++ Library support » U++ Core » what technique does U++ use to reduce code bloat from too many template instantiations?
Re: what technique does U++ use to reduce code bloat from too many template instantiations? [message #411 is a reply to message #410] Mon, 12 December 2005 21:44 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
fudadmin wrote on Mon, 12 December 2005 15:02

what technique does U++ use to reduce code bloat from too many template instantiations?



A good question Smile Actually, some of that is reduced by smart linkers (they are able to merge the same function).

Anyway, the really great reduction is result of U++ containers, esp. two things: Array container has really low footprint (it needs about 200 bytes pre instantiation) and Map containers are composites of Index and Array or Vector, with quite a lot Index hashing code implemented in non-template .cpp.

To explain composition issue: VectorMap<String, int> and VectorMap<String, String> are actually compostions of Index<String> and either Vector<int> and Vector<String> and "composition" code is really minimal. Compare with STL that generates totally different code for map<string, int>, map<string, string>, vector<string> and vector<int>. With more types involved, advantage on U++ side increases....
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Proposal: BinFindIndex should return 0 for empty container
Next Topic: Value with unsigned support
Goto Forum:
  


Current Time: Sun Apr 27 21:02:14 CEST 2025

Total time taken to generate the page: 0.00857 seconds