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
[llvm-nm] Improve performance while faking symbols from function starts
By default `nm` will look into `LC_FUNCTION_STARTS` for binaries that
have the flag `MH_NLIST_OUTOFSYNC_WITH_DYLDINFO` set unless
`--no-dyldinfo` flag is passed.
The implementation that looked for those `LC_FUNCTION_STARTS` in the
symbol list was a double nested loop that checked the symbol list over
and over again for each of the `LC_FUNCTION_STARTS` entries. For
binaries with couple million function starts and hundreds of thousands
of symbols, the double nested loop doesn't seem to finish and takes
hours even in powerful machines.
Instead of the nested loop, exchange time for memory and add all the
addresses of the symbols into a set that can be checked then for each of
the `LC_FUNCTION_STARTS` very quickly. What took hours and hours and did
not seem to finish now takes less than 10 seconds.
Fixes#93944
0 commit comments