Yes, you're right that it adds some memory and startup overhead. The
question that comes up is when you look at a whole system on whether this
matters. If 95% of the apps anyway link to QtDeclarative or scripting in
some way, it might not be a huge issue.

The relocations you mention below might be fixable by using -Bsymbolic and
-Bsymbolic-functions when linking QtV8.

Cheers,
Lars

On 9/6/11 12:38 AM, "ext Thiago Macieira" <[email protected]> wrote:

>On Monday, 5 de September de 2011 22:30:17 [email protected] wrote:
>> But if not used it doesn't really add any runtime overhead, so I wonder
>> how big of an issue this would be in practice.
>
>That's not actually true. There is an impact at runtime regardless of
>whether 
>you use it or not. You may judge the numbers to see if they are big or
>small, 
>produce
>
>The first impact is the size of the non-sharable sections.
>
>$ eu-readelf -l libQt{Core,V8}.so.5.0.0 /lib64/libpcre.so.0 | grep
>LOAD.*RW
>  Type           Offset   VirtAddr           PhysAddr           FileSiz
>MemSiz   
>Flg Align
>  LOAD           0x2dd000 0x00000000004dd000 0x00000000004dd000 0x0106d0
>0x011f38 RW  0x200000
>  LOAD           0x437228 0x0000000000637228 0x0000000000637228 0x065840
>0x069020 RW  0x200000
>  LOAD           0x03b610 0x0000003c7183b610 0x0000003c7183b610 0x000470
>0x000488 RW  0x200000
>
>Compare the size of QtCore's RW section (0x106d0 -> 0x11000 = 68kB) to
>QtV8's 
>RW section (0x65840 -> 0x66000 = 408 kB). That's per process.
>
>
>If I LD_PRELOAD QtCore and QtV8 into cat, which is a program that uses
>neither 
>library, I can find out how much memory needs to be faulted in simply
>because 
>of the library being present. The totals are:
>
>       QtCore: 432 kB sharable + 56 kB non-sharable
>       QtV8: 1552 kB sharable + 440 kB non-sharable
>
>Those are pages that need to read from the mass storage into main memory.
>
>
>The next impact is the relocations to be processed at load-time:
>$ relinfo.pl libQt{Core,V8}.so.5.0.0 /lib64/libpcre.so.0
>libQtCore.so.5.0.0: 3395 relocations, 2595 relative (76%), 223 PLT
>entries, 4 
>for local syms (1%), 0 users
>libQtV8.so.5.0.0: 47923 relocations, 46880 relative (97%), 120 PLT
>entries, 0 
>for local syms (0%), 0 users
>/lib64/libpcre.so.0: 46 relocations, 23 relative (50%), 25 PLT entries,
>13 for 
>local syms (52%), 37 users
>
>V8 has 18x more relative relocations than QtCore. All of those must be
>processed at load-time, unless prelinking was executed. It's about the
>size of 
>the current QtGui (pre-refactor) and QtXmlPatterns combined:
>
>libQtGui.so.5.0.0: 27781 relocations, 22008 relative (79%), 1473 PLT
>entries, 
>1 for local syms (0%), 0 users
>libQtXmlPatterns.so.5.0.0: 26012 relocations, 23240 relative (89%), 360
>PLT 
>entries, 0 for local syms (0%), 0 users
>
>
>-- 
>Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>   Software Architect - Intel Open Source Technology Center
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to