Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Huge perl binary file

by MisterBark (Novice)
on Jul 13, 2012 at 03:06 UTC ( #981544=note: print w/replies, xml ) Need Help??


in reply to Re: Huge perl binary file
in thread Huge perl binary file

Interesting, thanks!
How can I make sure that all the static libs are required in all situations?
Does a  perl -e 'print("hello\n");'  really need all the libaries? if not, is there a way the select which ones I compile in the bin? (and know which ones are included in a previously built binary)
 
Tbanks!

Replies are listed 'Best First'.
Re^3: Huge perl binary file
by mbethke (Hermit) on Jul 13, 2012 at 03:51 UTC
    You can check with ldd---here's my dynamic version:
    mb@aldous ~ $ ldd /usr/bin/perl5.14.2 linux-vdso.so.1 => (0x00007fff5677e000) libperl.so.5.14 => /usr/lib64/libperl.so.5.14 (0x00007f62b38ff +000) libc.so.6 => /lib64/libc.so.6 (0x00007f62b356d000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f62b3369000) libm.so.6 => /lib64/libm.so.6 (0x00007f62b30e5000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f62b2eae000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f62b2c91000) /lib64/ld-linux-x86-64.so.2 (0x00007f62b3c81000)

    I've never bothered to look at how to configure static vs. dynamic compilation but given that both versions exist it must be possible.

    I wouldn't worry about it too much though, as another nice feature of virtual memory systems works in your favor: paging. What Linux basically does when loading a binary is just to mark it loaded but paged out to its file. Then when something accesses the image in memory it gets automagically loaded, but in chunks of usually 4 KB, the size of an MMU page. So stuff that's never run is also likely never loaded, unless it has other code that has already been run in its vicinity. It's all pretty damn efficient anyway unless it's C++.

Re^3: Huge perl binary file
by DrHyde (Prior) on Jul 13, 2012 at 10:38 UTC
    If that sort of micro-optimisation is actually going to give you any significant advantages, then You're Doing Something Wrong.

      That was my initial thought as well ... meh 1.2M when we live in a much larger world now; however, I started looking at it and while my stock redhat binary is 16K, my own build (perlbrew) is 900K -- the difference being whether libperl (and libresolv) are static or not. It's an interesting build question at a minimum -- like the vendors are not doing default builds.

      -derby

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981544]
help
Chatterbox?
[stonecolddevin]: o/ planetscape
[Sinistral]: I think that just the sight of his username now causes a downvote storm. I agree, and the gratuitous use of formatting does make reading hard. I've given him +1 on things where there seemed to be actual good advice, but I think the big
[Sinistral]: nail in coffin was the rant against a Schwarzian Transform
[stonecolddevin]: at best, from what i've seen, his knowledge is accurate up to maybe 2002. the sheer volume of words is mostly worthy of a downvote in most cases though i think
[erix]: ITYM Schwartzian Transform :P
[erix]: hey planetscape :)
[planetscape]: howdy stonecolddevin, erix
[Sinistral]: eric Aye. I thought I typed that wrong. All hail Randall! I listen to him on FLOSS Weekly
[Discipulus]: i think his vacuus, trombon like, absence of meaning, joined with a ostentatious style, after many years irritates the most
[erix]: easy to get wrong -- I guess that was sund's point, too :P

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-06-22 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (530 votes). Check out past polls.