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

Adds an opcode count stat to the disassembler #2137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ike709
Copy link
Collaborator

@ike709 ike709 commented Dec 12, 2024

stats opcode-count will now print the number of occurrences of every opcode in a disassembly file.

Example from TG:

> stats opcode-count 
Counting all opcode occurrences. This may take a moment.
Opcode: Count
PushReferenceValue: 251,825
Call: 140,603
PushFloat: 119,568
Pop: 118,163
PushString: 110,316
JumpIfFalse: 106,655
AssignNoPush: 102,418
PushRefAndDereferenceField: 75,681
Jump: 64,159
DereferenceCall: 57,392
[snip]

I manually verified about 20 of them against the .dmd file with Notepad++'s Count and the numbers all matched.

Also changed procs-by-type to print commas in its output to make it easier to read.

@boring-cyborg boring-cyborg bot added the Compiler Involves the OpenDream compiler label Dec 12, 2024
@ike709 ike709 requested a review from wixoaGit December 12, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler Involves the OpenDream compiler size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant