Sunday, October 31, 2021

Delphi Executable File Size

A friend asked if I had noticed that the size of executables generated by the latest version of Delphi (Delphi 11 Alexandria), seemed smaller than in the previous version.

Interesting.

I hadn't heard anyone talk about this in a while. Delphi file sizes tend to increase with each new version as new features are added and more things are stored in the executable. It used to be quite the topic of conversation.

Of course, it's (very) rare that the size of Delphi executables poses any kind of real problem. Until a few years ago, a company with lots of remote locations still had a handful using dialup for their Internet connections. It wasn't super fast, but even occasional software updates were reliable and ran "fast enough". Except the one site that literally had a party line, so any long transfer during business hours was a bit of a nail-biter. True story.

So, long story short, I had not noticed, but this seems like a testable thing.


The Test

I created three new empty applications with no added code:

  • Empty console application
  • Empty VCL application
  • Empty FireMonkey application (Windows)


Using the four most recent Delphi compilers, I built each application using Debug and Release configurations for Win32 and Win64 for a total of 48 executables. I used default settings and didn't do anything to affect .exe size.

Update: I also built the Empty FireMonkey application using Debug and Release configurations for Android 32-bit and Android 64-bit platforms to compare the .apk file sizes. I didn't have Android development set up for 10.2.3 Tokyo, so numbers are only included for the three most recent Delphi compilers.

  • Delphi 10.2.3 Tokyo
  • Delphi 10.3.3 Rio
  • Delphi 10.4.2 Sydney
  • Delphi 11 Alexandria


The Results



That's a lot of numbers. Maybe I'll come up with a better way to visualise these. In the mean time, here's the upshot:

  • Console application size actually increased by 1.27% to 2.22% between Delphi 10.4 and 11.
  • VCL application size, on the other hand, decreased by about 10.5% to 13.5% while FireMonkey decreased by about 12% to 15% in the latest version, so sizes are close to or lower than they were with 10.2.
  • Android .apk file sizes decreased by about 30% to 34% in the last version.

Nice.

I still don't think executable file size is that important in the grand scheme of things and I'm not sure that size reduction is even one of Embarcadero's goals, but this still makes me smile.

2 comments:

Unknown said...

Yeah, even if it's not a priority, it's a nice thing.

Stefan Glienke said...

This is most likely because they fixed this issue which I reported:
https://quality.embarcadero.com/browse/RSP-30870