You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
General case for investigating and reducing bloat.
Compiling using Clang with -ftime-trace produces .json files next to the object files (.o), which can be loaded in Chrome to investigate compile times.
chrome://tracing/
Using nm with --print-size we can examine object files (.o) to determine what symbols contribute the most space to the object file. This can be used to determine which source code elements produce the largest amount of code bloat. It may also be helpful to pass the --demangle flag.
It may be helpful to leave off the uniq call, to get a better sense of how often a symbol may appear.
We can get much of the same information as nm from the linker (ld) by generating a map file. This can be done with the custom makefile variable LDFLAGS_EXTRA:
export LDFLAGS_EXTRA="-Wl,-Map=mapfile"
The -Wl, is used to pass a flag to the linker. The -Map=mapfile is the linker flag to generate the mapfile. Use % as the filename to get the output filename with .map added.
General case for investigating and reducing bloat.
Compiling using Clang with
-ftime-trace
produces.json
files next to the object files (.o
), which can be loaded in Chrome to investigate compile times.chrome://tracing/
Using
nm
with--print-size
we can examine object files (.o
) to determine what symbols contribute the most space to the object file. This can be used to determine which source code elements produce the largest amount of code bloat. It may also be helpful to pass the--demangle
flag.Potentially the whole build folder can be scanned and sorted by symbol size:
It may be helpful to leave off the
uniq
call, to get a better sense of how often a symbol may appear.We can get much of the same information as
nm
from the linker (ld
) by generating a map file. This can be done with the custommakefile
variableLDFLAGS_EXTRA
:The
-Wl,
is used to pass a flag to the linker. The-Map=mapfile
is the linker flag to generate the mapfile. Use%
as the filename to get the output filename with.map
added.Related:
Delegate
#1218Filesystem
#1215The text was updated successfully, but these errors were encountered: