← Back to context

Comment by Peter5

1 month ago

2.5 MB is for most of the Lazarus Component Library (LCL) with minimal size increases even as program complexity grows. For example, Dadroit JSON Viewer EXE is less than 6 MB while having complicated tree views, JSON handling, networking, and more. By the way, an empty CLI EXE on Windows is less than 50KB.

Why doesn't the linker strip out unused code?

  • I imagine it's for the same reason Delphi can't strip much, which is that it supports run-time reflection. You can create an instance of a class using a string of the name.

    Forms (windows) are deserialized during loading, which relies on this mechanism.