Find similar functions#358
Conversation
|
Can you add a option to only scan current module? |
This is a good idea and worth exploring, but I’d prefer to revisit it after landing some optimizations in a future PR because it needs a little bit of UI thought. Should comparing against the same object be a separate context menu entry? Should there be a base only, target only option? Or should the search itself respect the filtering options and wait for a user to hit a "Search" button which is an extra step each time they want to do a diff. It's relatively trivial to add a checkbox to restrict the filter to "Same object" so I've added that to the PR.
If the global diffing performance was so quick that most people didn't even notice then it wouldn't be a problem to just hit a single checkbox right in theory which is the lesser of all of the evils I think. I have a change waiting to go after this which adds a new On Windows, a large portion of the time spent comparing objects comes from objdiff repeatedly spawning the build process. That’s not really an objdiff issue. It’s more a consequence of Windows being slow at launching lots of processes in parallel. This change shifts the approach so objdiff can trigger a single “build everything” step, letting the build system efficiently determine what actually needs rebuilding from a global perspective. In practice, that means handing control over to Ninja to do its job, instead of incurring the overhead of constantly spawning new processes. The comparison speed is relatively quick after that, but in the demo the comparison code is currently single threaded too. That’s another area that needs improvement and should reduce comparison times substantially. The demo video is pretty much a worst-case example of where things are at in this PR. That’s a 19MiB executable with ~61500 functions comparing against another function that isn’t exactly small. WIP |
Should be fixed in HaydnTrigg@88ddb07 |
Nice, thanks. One other similar case I didn't think to test the first time: If you use "File -> Project" or "File -> Recent Projects" you can switch to another project but the job still keeps running for the old one. Otherwise everything LGTM |



Adds a new "Find similar functions" context menu entry on both target/base.

This opens a window which scans against all of the objects both base and target and shows a bunch of rows sorted by match %
Demo Video
Resolves: #284