microsoft / SizeBench

SizeBench is a binary size investigation tool for Windows
MIT License
103 stars 14 forks source link

Direct Analysis of Lib File Sizes #42

Open wonderzdh opened 2 months ago

wonderzdh commented 2 months ago

Is your feature request related to a problem? Please describe. Currently, the tool can only analyze the size of linked PE format files, and cannot directly analyze the size of lib files. This limits our understanding and optimization of the library files themselves.

Describe the solution you'd like I would like the author to add a new feature that allows direct analysis of lib file sizes, without the need to link them into PE format first. This feature should be able to:

  1. Read and parse the lib file format
  2. Display the size of each object file (.obj) within the lib file
  3. List all symbols (functions and variables) in the lib and their sizes
  4. Provide overall size statistics for the lib file
  5. If possible, compare size changes between different versions of lib files

Describe alternatives you've considered

  1. Using other specialized lib analysis tools, but this requires switching between different tools, which is not convenient.
  2. Manually unpacking lib files and analyzing the .obj files within, but this process is tedious and prone to errors.
  3. Modifying the compilation process to generate intermediate files for analysis, but this might affect the normal build process.

Additional context This feature would help developers better understand and optimize their library files, especially in scenarios where reducing the final executable size is necessary. It can help identify which parts of the code contribute most to the size, thus guiding optimization efforts. Additionally, for cross-platform development, being able to directly analyze lib files for different platforms would also be very helpful.