Allergo, Y U SO FAT?
Chris Katko

I do my hobby work on my little netbook these days. It's got a paltry <32 GB SSD and it's pretty full so I was doing some filesystem analysis. Well, surprise-surprise came upon me when I found the Allegro 5 directory was like 600MB-1 GB. Why?

Because every executable ... is 5.1 MB. And there are like 200 examples.

My question is... why is Allegro so large? 5 MB is like... almost C#/Mono territory.

Perhaps it's the debug / profiling symbols? These are Allegro examples so there's literally nothing else in there except Allegro, Allegro dependencies, libc, and a ~100 lines of example code.

Linux. Ubuntu ~16. Allegro 5.1.x / git from a few months ago.

amarillion

I do know that the static build (`-DWANT_STATIC_RUNTIME=on`) uses much more disk space than otherwise. And since each example is statically linked, the example directory is blown up enormously.

If you compile a static build, do a -DWANT_EXAMPLES=off (if you still need the examples, do a separate non-static build)

Edgar Reynaldo

Wow. Ubuntu sucks. ;)

Allegro's GIT src directory weighs in at 74MB.

My binary distribution of Allegro 5.2.2 is 75MB including dynamic debug examples, tests, and demos, as well as all dependencies.

SiegeLord

A big fraction of bloat in the core library is due to the dynamically loaded OpenGL symbols. It'd be great to have a good solution for that.

Gideon Weems

I think the solution is what amarillion described. Forego static examples. Does that not solve the problem?

Thomas Fjellstrom
SiegeLord said:

A big fraction of bloat in the core library is due to the dynamically loaded OpenGL symbols. It'd be great to have a good solution for that.

Is it just all of the pointers that bloats up the library? Dynamic lookup of some weird kind would be interesting.

Have actual inline functions/macros that perform the lookup at runtime and cache them in a table, rather than a bunch of pointers that have to stay around, only the calls that are used will end up sticking around in the final linked program. assuming a static build anyhow. If macros, it'd automatically inline, if inline functions in a header, it'd work, if regular functions in allegro, they'd have to be provided in a separate static library in order to eliminate unused code.

torhu

Is it just all of the pointers that bloats up the library? Dynamic lookup of some weird kind would be interesting.

Having all the function names as strings probably doesn't help either...

Neil Roy

My Deluxe Pacman 2 game is statically linked and the release executable is just over 1 MB, the debug is just over 14MB so... Allegro is NOT FAT! It's probably your operating system that is the pig.

Besides, who in the hell worries about the size of a debug version?! It's supposed to be fat.

Thread #616937. Printed from Allegro.cc