So! "Sizer", windows executable size reporting tool. It was time to resurrect it, make it stop using msdia_*.dll and instead use @molecularmusing raw_pdb.

Much faster, hopefully better as well.

Testing would be appreciated! https://github.com/aras-p/sizer/releases/tag/v0.5.0

Release v0.5.0: large speedup, no more DIA SDK · aras-p/sizer

Large speedup and removed dependency on msdia*.dll, by switching to MolecularMatters/raw_pdb library for PDB file parsing. Sizer no longer uses MS DIA SDK, so maybe someday it will be able to run o...

GitHub
@molecularmusing ...aaand now Sizer itself can run on Mac or Linux too. It still only analyzes windows executables/PDBs of course. https://github.com/aras-p/sizer/releases/tag/v0.5.1
Release v0.5.1: multi-platform and cmake · aras-p/sizer

Sizer now builds on Windows, Mac and Linux. Note that it still only analyzes the Windows executables/PDBs, but can do that while running on Mac/Linux. The build system was changed to CMake. Github ...

GitHub
@aras @molecularmusing Just as I archived https://github.com/zeux/codesize a month or so ago :D
GitHub - zeux/codesize: Code size visualization tool with PDB/ELF/Mach-O support

Code size visualization tool with PDB/ELF/Mach-O support - GitHub - zeux/codesize: Code size visualization tool with PDB/ELF/Mach-O support

GitHub
@zeux "archived by the owner on Jan 4, 2023" I think you lost 6 months of time awareness!
@aras Oops :) I guess I gradually archived a bunch of older projects and forgot when I started!
@aras @molecularmusing Just when I was thinking its probably time we start caring more about Godot binary sizes (we never kind of did because its still small when compressed). Great timing and thanks for the tool!
@reduz @aras @molecularmusing There's also Microsoft's own SizeBench tool to consider these days, which provides a lot of useful information, like how much is duplicated/wasted between multiple instances of the same template function, or if some static data is present in multiple compilation units. It also gives you the ability to diff two PE files to see what exactly caused an increase in size: https://devblogs.microsoft.com/performance-diagnostics/sizebench-a-new-tool-for-analyzing-windows-binary-size/
SizeBench: a new tool for analyzing Windows binary size - Performance and Diagnostics

A new static analysis tool called SizeBench has been released to the Microsoft Store, which helps with understanding binary size on Windows.

Performance and Diagnostics
@mihe @reduz @molecularmusing I tried SizeBench just two days ago. First impression: 100+ MB app size is funny for a size optimization tool :) Then, it refused to work on any PDBs I had, mostly saying "yo, incremental linking, I can't do that"
@mihe @reduz @molecularmusing ...but cmake default RelWithDebInfo, i.e. the only sane config that produces PDBs for optimization, does also enable incremental linking by default! This makes SizeBench not work on like 99% of cmake based projects, without custom build hacks :(
@aras @reduz @molecularmusing Right, yeah, that's a bummer. I was curious why I hadn't run into that limitation, and it seems to be because I enable LTCG through CMake's INTERPROCEDURAL_OPTIMIZATION property, which rightfully disables incremental linking. LTCG tends to be a non-starter for larger projects though, from what I've seen, and at that point you might as well just append /INCREMENTAL:NO yourself I guess.

@aras Thank you. After your post, tried to get the same info for @defold (it builds with Clang) and analize it on Mac. It's not so hard to do by adding
'-Wl,-map, output.map' as linker flag and using https://apps.apple.com/app/fastlinkmapanalyzer/id1595283055 as viewer.

I can't say it was super useful in my case, because it's hard to squeeze out kilobytes from already small code.
But it's good to know that it's possible to get and analyze this info easily.

‎FastLinkMapAnalyzer

‎FastLinkMapAnalyzer is a link map file analyzer for iOS and macOS app developers. With FastLinkMapAnalyzer, developers can visualize code size of a final app binary, and group code size by source folder structures, even inspect every module size in a third-party framework. Features √ Fast, analyze…

Mac App Store
@aras Great stuff Aras!
Please feel free to open a PR if you feel useful stuff is missing in raw_pdb. It's certainly not a complete msdia replacement yet.
@molecularmusing I did open one tiny one-liner PR. Everything else worked like a charm (besides PDB itself being kinda strange, but that’s life)
@molecularmusing ohh lol, I failed at GitHub and opened PR to the wrong repo :/ https://github.com/aras-p/raw_pdb/pull/1
Add DBIStream::GetHeader() by aras-p · Pull Request #1 · aras-p/raw_pdb

This can be useful for tools to check whether the PDB is stripped (header.flags & 2) or whether it was produced with incremental linking (header.flags & 1).

GitHub