In general, llvm-link is faster to link 2 files than 200 files that contain
the same data. So if you have 200 files as inputs, and there is some
natural library structure anyhow where 100 go in one library and 100 in
another, you may want to link them that way (which can be done in parallel,
too), then give the final emcc command just the 2 big files.

.a files contain individual files internally, so linking 100 files to one
.a has no effect in terms of compilation speed (might even be a little
slower since it needs to extract them). Linking to a .bc or .so file that
contains LLVM bitcode is what can be helpful.

On Sun, Apr 29, 2018 at 9:57 PM, Mark Sibly <[email protected]> wrote:

> Hi,
>
> I am having a poke around looking for ways to improve link times and came
> across this:
>
> > It's more efficient to create a hierarchy, linking .os into bigger .bc
> files
>
> How exactly do I do this? Is it as simple as 'g++ obj1.o obj2.o obj3.o -o
> mylib.bc'? Can I then link with 'mylib.bc' the way I would with a '.a' file?
>
> I'm currently archiving all my '.o' files using the 'emar' tool and
> linking with the resultant '.a' archives. All told, there are probably
> around 100-ish object files (probably more) but only about 10-ish archives,
> and linking with these is taking ages, about 50s. I assume this is more or
> less the same as just linking with the 100 object files?
>
> Bye!
> Mark
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to