Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Reko disassembly speed #1227

Merged
merged 4 commits into from
May 8, 2024

Conversation

AnErrupTion
Copy link
Collaborator

This PR drastically improves the disassembly speed when using Reko (a.k.a. the -output-asm CLI argument). The main problem was that the MOSA Disassembler class would:

  • Read every disassembled instruction from the list created by the Reko library
  • Create a whole new list with a few modifications in the string representation
  • Read every instruction from that newly created list, the most common scenario being to write them into a file

This is indeed much slower, so this PR fixes it by simply having a DecodeNext() method in the Disassembler class, which makes it act like an enumerator.

@AnErrupTion AnErrupTion self-assigned this May 8, 2024
Signed-off-by: AnErrupTion <[email protected]>
Signed-off-by: AnErrupTion <[email protected]>
Copy link
Member

@charsleysa charsleysa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: AnErrupTion <[email protected]>
@AnErrupTion AnErrupTion removed the request for review from tgiphil May 8, 2024 09:16
@AnErrupTion AnErrupTion merged commit 279a4c1 into mosa:master May 8, 2024
66 checks passed
@AnErrupTion AnErrupTion deleted the fast-reko-disasm branch May 8, 2024 09:36
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.

2 participants