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 » Value size ?
Re: Value size ? [message #42907 is a reply to message #42904] Mon, 14 April 2014 06:00 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
mingodad wrote on Sun, 13 April 2014 21:43
I saw in several places talking about efficiency but when I look at sizeof(Value) == 48 (64bits) I'm not sure about it.


sizeof(Value) is 16 bytes. I guess you have tried in DEBUG, where there is some additional diagnostics data.

Quote:

I saw that Value has a String member called "data" and also an Atomic member called "refcount" to be used in special cases, but String also has the same "refcount" for special cases, isn't it a repetition ?


Not at all.

Quote:

I was looking at sizeof(boost::any) == 8 (64bits) and sizeof(cdiggins::any) == 16 (64bits)


How much _total_ memory would boost::any consume if you assign it an int or "Hello world"?

Value will still use 16 bytes _total_ in both cases.

BTW, to investigate such issues further, there is benchamarks/sizeof which I use to track this. Also funny is benchamrks/idmapBench, which benchmarks (among others) ValueMap against STL (that is, high-level U++ thing against low-level STL thing).

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: How is the u++ repository organized ?
Next Topic: Pop3 class and reference examples for U++
Goto Forum:
  


Current Time: Wed May 15 19:13:39 CEST 2024

Total time taken to generate the page: 0.01912 seconds