Am 15.07.2014 um 12:07 schrieb Rutledge Shawn <shawn.rutle...@digia.com>:

> ...
>> 
>> Yes, that's the downside of BYOL ("Bring Your Own Libraries") ;) [...]
>> 
>> But with spinning hard disks the size of terrabytes and SSDs the size of.... 
>> Hey! Wait a minute! ;)
> 
> But you probably don't have terabytes of RAM,

We're getting there ;)

No, seriously...

> and cache is limited too, and maybe the libraries still get loaded multiple 
> times when you run multiple applications if they are actually different 
> versions (or maybe even if they aren't).

My educated guess would be that even if you had two identical copies of, say, 
the Qt libs and they would be dynamically linked by two distinct executables 
(each linking with its own Qt copy) then they would also be loaded twice into 
memory.

Otherwise the dynamic runtime linker would have to compare every bit of a newly 
to be linked library with any other library being currently in memory, in order 
to verify the identity of those libs.


>  I was thinking the solution to both problems might be some sort of 
> deduplication by hashing, both in storage and in memory.  It could be done at 
> a block level or at the level of individual functions.  It's probably a 
> research project somewhere...

Interesting thought: that would probably require support by the compiler and/or 
linker: not only would it have to hash (exported) method/function signatures 
("symbols" in general), but the entire implemenation in order to guarantee 
identical behaviour.

That would off course imply that the libraries are compiled with the same 
"compiler flags" (and in the end by the same compiler): if just one bit was 
different then the libraries are already to be considered "different".

Maybe one could partly re-use stuff on a "function level", as you proposed, 
such that only functions/symbols with different hash values would be loaded 
into memory.

But how would you resolve adresses to "global resources" in such functions, or 
adress resolution in general? I'm not a compiler guy, but I can tell that this 
indeed would be a challenging research topic! ;)

Cheers,
  Oliver
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to