Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Allergo, Y U SO FAT?

This thread is locked; no one can reply to it. rss feed Print
Allergo, Y U SO FAT?
Chris Katko
Member #1,881
January 2002
avatar

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.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

amarillion
Member #940
January 2001
avatar

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)

--
Martijn van Iersel | My Blog | Sin & Cos | Tegel tilemap editor | TINS 2017

Edgar Reynaldo
Member #8,592
May 2007
avatar

SiegeLord
Member #7,827
October 2006
avatar

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.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Gideon Weems
Member #3,925
October 2003

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

Thomas Fjellstrom
Member #476
June 2000
avatar

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.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

torhu
Member #2,727
September 2002
avatar

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
Member #2,229
April 2002
avatar

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.

Go to: