Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Shared libraries

Name: Anonymous 2010-09-25 14:06

Why do some apps like Chrome and Firefox have tiny main executables and pack everything in a big shared library that contains everything? It's not like there are other users of the library, and at least on some systems executables should perform a bit better (no risk of needing to be relocated on load).

Other big programs do the logical thing and provide a large executable and no shared libraries. I have even seen some that changed the policy from version to version. What I'm asking is why would you put anything that is only used by a single program outside the executable.

Name: Anonymous 2010-09-25 14:42

Because the "main executable" of Firefox is just a shell script to setup the environment, and its less annoying to do that in shell than in C

Name: Anonymous 2010-09-25 14:48

>>2
You're wrong. Ignore the script, the rest still applies.

Name: Anonymous 2010-09-25 15:10

>>1
Because GNU/Firefox is Free Software, which means that it values the Freedom to Share. Computer users should be free to modify programs to fit their needs, and free to share libraries, because helping other people is the basis of society.

The organizations that profit most from copyright legally exercise it in the name of the authors (most of whom gain little). They would have you believe that copyright is a natural right of authors, and that we the public must suffer it no matter how painful it is. They call sharing “piracy”, equating helping your neighbor with attacking a ship.

They also tell us that a War on Sharing is the only way to keep art alive. Even if true, it would not justify the policy; but it isn't true. Public sharing of copies is likely to increase the sales of most works, and decrease sales only for big hits.

Name: Anonymous 2010-09-25 16:00

>>3
Libxul is a large part of firefox, but there is no reason that it cannot be used by another project, therefore it is a separate shared library.

Name: Anonymous 2010-09-25 16:19

>>5
But what ships with Firefox isn't really "libxul". Inside that you have *EVERYTHING*, including all-specific Firefox code. The Firefox user agent string is inside that file.

The only external things used by Firefox are NSS (SSL networking I think) and sqlite3, and whatever common system-wide libraries it uses.

Put it another way, nobody has ever used the xul shared library that ships with Firefox. Doing it would be suicide anyway — it's not supposed to be public.

Now you're going to tell me everybody is eager to use the several–dozen–of–megabytes–big Chrome lib.

Name: Anonymous 2010-09-25 16:31

Could be a way to separate some platform specific launch code from the main program logic, or to load other stuff in parallel while you're waiting for the main program. If Chrome does it, there's probably not a noticable performance penalty, because I'm pretty sure they've tweaked the hell out of the startup.

Name: Anonymous 2010-09-25 16:34

>>7
They did collect telemetry data to see how often it was relocated and tweaked the base address in response.

Name: Anonymous 2010-09-25 16:47

>>7
Could be a way to separate some platform specific launch code from the main program logic, or to load other stuff in parallel while you're waiting for the main program.
Neither of these sound really convincing.

Name: Anonymous 2010-09-25 17:16

>>1,6,9
I'm not certain the thread understands your question about Firefox (and Chrome) to the same extent you intend.  What's the difference between putting everything into a separate library and putting everything inside the executable to you? in the end, there is still one large file.

Name: Anonymous 2010-09-25 17:17

It's just an ENTERPRISE QUALITY loading scheme.

Name: Anonymous 2010-09-25 17:28

>>10
It's one more file, and a bit of extra work. Why would you do that, if there is no difference?

Name: Anonymous 2010-09-25 17:29

>>1,10

Think of it like this.  When you click a link in a document, and there is no browser open, the browser will launch and go to the URL.  If there is a browser, a new tab is made.

If the executable only has launch code, it can decide if it needs to load the library again, or just tell the existing process to open a tab.

Also, in the future, /prog/ is a really bad place to ask serious questions.

Name: Anonymous 2010-09-25 17:58

>>13
It's not the best place, but not completely bad either if you can tell the serious replies.

Name: Anonymous 2010-09-25 18:12

>>13
It really depends on the question. I've seen some good answers for obscure questions, and also some really bad answers for normal questions.

Name: Anonymous 2010-09-25 18:58

>>15
Ever heard of ``elitism''?

Name: Anonymous 2010-09-25 19:55

>>16
Ever heard of ``autism''?

Name: Anonymous 2010-09-25 20:11

>>17
Ever heard of ``jism''?

Name: Anonymous 2010-09-25 20:41

>>18
Ever heard of ``nihilism''?

Name: Anonymous 2010-09-25 20:45

>>19
Ever heard of ``communism''?

Name: Anonymous 2010-09-25 20:54

>>20
Ever heard of ``bbcodeism''?

Name: Anonymous 2010-09-25 21:02

>>13
If the executable only has launch code, it can decide if it needs to load the library again, or just tell the existing process to open a tab.
Is there a load cost relative to the size of the executable which you have to pay even when other copy is already loaded? In any case this doesn't sound unreasonable.

Name: Anonymous 2010-09-26 4:20

>>22
In any case this doesn't sound unreasonable.
If that sounds less unreasonable than some of the other suggestions in this thread that have been dismissed as unconvincing, that's only because you don't understand how computers work.

Name: Anonymous 2010-12-25 21:40

Don't change these.
Name: Email:
Entire Thread Thread List