Skip to content

Conversation

@LagoLunatic
Copy link
Collaborator

First commit optimizes diffing by moving the expensive string processing logic out of the loops being run to compare every symbol to every other symbol, and instead doing the logic just once while reading the object so that simple string equals checks can be used in the loop.

Second commit optimizes diffing more by using min in the loops instead of sorting.

Third commit optimizes this same part even further by removing the min in the loop and instead sorting all symbols once when the object is read. Moving the sorting earlier had the unintended side effect of fixing a subtle bug in diff_bss_section that I didn't know about: it assumes the bss symbols are in order and only compares their sizes, so when they're not in the right order it will report <100% if the bss symbol names don't match. Now it doesn't care about bss symbol names as long as the sizes match - this was the originally intended behavior for diff_bss_section, right?

@LagoLunatic
Copy link
Collaborator Author

Comparison for the bss section change:
Before:
image
After:
image

It now shows 100% even though the symbol names don't match. Seems like that was the intended behavior, though I'm not sure if that might be too lenient now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant