MapFileStats is a simple free utility to obtain executable binary size statistics derived from a “.map” file.
Use it to know which units contribute the most to an executable’s size, which DFMs are the largest, which units you have dependencies on but barely use in your executable, or merely to know exactly what gets into your executable.
You can integrate it into the Delphi IDE via the Tools menu, see the MapFileStats page for more details or to the download page and see for yourself!
5 thoughts on “MapFileStats public release”
This looks like a nice tool (the JCL has something similar as well).
Here are a few comments, if you’re interested:
I noticed the error dialog (missing .map file, etc.) is in French but the rest of the UI is in English.
I ran it for a D6 .DLL with some VCL forms in it and noticed that all of the .dfm sizes were blank (“-“). Then I realized you have to set the “Search Files In” to get that to work. Maybe that value could default to the root directory of the exe, since that seems to be a common directory layout. Or maybe the tool could scan the exe to get the actual dfm resource sizes, though this might expand it beyond your intention.
Also, maybe it would be good to auto-click “Go” if you start the application with the exe name on the command line (from the IDE) in my case (assuming you auto-set the “Search Files In”).
It might also be helpful to have a file filter of *.map in the file open dialog.
Maybe there could be a way to filer out units only shown due to linking to the unit in a runtime package (all of those tiny < 100 byte units I see in the list).
Thank you for your helpful tool!
Just one small suggestion: My project’s dcu and dfm sit in the different folders. So could you create two search paths please?
Some of your suggestions will definetely get in a next release, though a better place to post suggestions might be in the forums (link to the right) 😉
Erik, the small units are one of the reasons to check the Map file, not as much to reduce binary size, but to eliminate unneeded dependencies and spot units with lots of “dead” code, so they can be modularized or refactored out (as dead/unused code isn’t “free” in terms of maintenance).
Also, Ctrl-A to select all does not update the selection details in the status bar.
The MapFile editbox defaults to: S:\PrjQuBES\QuBES\QuBES.map and the Search for Files in defaults to S:\. I browsed my map file and didn’t change the Search for files in. I have a backup drive s:\, when pressing Go the UI would not refresh, I think it was scanning that huge drive.
Thanks for the report Mike, though a better place to post suggestions might be in the forums (link to the right).
The Ctrl-A is fixed for 1.2 already, and default Exe name will be reused from the previous execution (though you might want to use the macro in the Delphi tools menu instead for that, see MapFileStats page).
The SearchForFiles path is used to look for DCUs & DFMs, so yes, everything in the path is currently scanned.
Comments are closed.