⚡ Cache label provider capability lists in IntelDisassembler#84
Merged
danielplohmann merged 1 commit intodanielplohmann:masterfrom Mar 23, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 What
Cache API-capable and symbol-capable label providers when IntelDisassembler registers them, and reuse those cached lists for API lookup, symbol lookup, and symbol-candidate collection.
🎯 Why
The disassembler was repeatedly scanning the full
label_providerslist and rechecking provider capabilities on hot paths like symbol candidate collection and label resolution. That adds avoidable Python loop and method-call overhead during setup and lookup.📊 Measured Improvement
A focused setup microbenchmark of
_updateLabelProviders()plusgetSymbolCandidates()improved from 2.353s to 2.198s over 50,000 iterations, which is about 6.6% faster.To isolate the exact loop change, I also benchmarked the old full-list symbol-candidate scan against the new cached symbol-provider iteration. That dropped from 10.220s to 6.100s over 200,000 iterations, reducing loop time by about 40.3%.
Validation:
python -m ruff format smda/intel/IntelDisassembler.py tests/testIntelDisassembler.pypython -m ruff check .python -m unittest discover -s tests -t . -p "test*.py"