Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Fallacies that advocate software bloat (Miscellaneous)

posted by marcov, 31.12.2025, 15:11

> > Breaking up the source into smaller "modules" doesn't actually decrease
> > the bloat -- it just hides it.

Bloat is an unscientific term. But modularisation has very small overheads (like per module ctor/dtor, specially when table based). Some of those can be mitigated by global optimisations.

> I thought joining all of the modules into one single source file would
> increase the amount of memory required to compile the program, versus
> compiling a bunch of little objects and linking them together.

That depends. The compiler might eat more memory in the single source file case, but more labels have been resolved in the .o that it provides and the linker might consume less memory (*)

If half of your code is in static inline in other modules headers, you still got almost the entire program to process in your main module.

Optimisations over module borders are relatively expensive. But it is a trade off for a better result. Note in the single file case, multi pass compilers kind of do similar things.

> Also, smaller modules would be easier to grasp in the biological memory of
> the software maintainer. I guess that would be "hiding" the complexity,
> kind of like OOP design.

Yes. A bit of encapsulation and information hiding. Also promotes reuse a bit more.

(*) Since gcc/binutils afaik still doesn't have section smartlinking on Windows, creating a .o per symbol is the only way to have fine grained smartlinking. I've seen LD.exe use 1.5GB to link a 10-15MB EXE file (or 2.5 times that with debuginfo) in such case. If we hadn't implemented an own linker, we probably would use a 64-bit hosted linker to generate 32-bit binaries by now (36M EXE, 500MB magnitude with debug info)

 

Complete thread:

Back to the forum
Board view  Mix view
23153 Postings in 2179 Threads, 404 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum