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 a system for printing stats to the disassembler #2067

Merged
merged 7 commits into from
Dec 11, 2024

Conversation

ike709
Copy link
Collaborator

@ike709 ike709 commented Oct 27, 2024

This adds a stats command to the disassembler which can be extended to provide various info about the bytecode. For now I've added a procs-by-type argument which prints the number of proc declarations on each type in descending order.

I've also spruced up the help command with the ability to take a command argument to learn more about a specific command.

Here's an excerpt from TG:

Counting all proc declarations by type. This may take a moment.
Type: Proc Declarations
<global>: 1595
/datum/controller/global_vars: 979
/client: 504
/mob/living: 441
/atom: 359
/mob: 328
/mob/living/carbon: 184
/atom/movable: 131
/obj/item: 128
/mob/living/carbon/human: 101

@boring-cyborg boring-cyborg bot added the Compiler Involves the OpenDream compiler label Oct 27, 2024
@ike709 ike709 requested a review from wixoaGit October 27, 2024 21:59
DMDisassembler/Program.cs Show resolved Hide resolved
DMDisassembler/Program.cs Fixed Show fixed Hide fixed
DMDisassembler/Program.cs Fixed Show resolved Hide resolved
DMDisassembler/Program.cs Show resolved Hide resolved
DMDisassembler/Program.cs Outdated Show resolved Hide resolved
DMDisassembler/Program.cs Outdated Show resolved Hide resolved
DMDisassembler/Program.cs Outdated Show resolved Hide resolved
DMDisassembler/Program.cs Outdated Show resolved Hide resolved
ike709 and others added 3 commits December 11, 2024 17:05
Co-authored-by: wixoa <wixoag@gmail.com>
Co-authored-by: wixoa <wixoag@gmail.com>
Co-authored-by: wixoa <wixoag@gmail.com>
@ike709 ike709 requested a review from wixoaGit December 11, 2024 23:05
@wixoaGit wixoaGit enabled auto-merge December 11, 2024 23:07
Console.WriteLine("Type: Proc Declarations");
foreach (var pair in typeIdToProcCount.OrderByDescending(kvp => kvp.Value)) {

var type = TypesById[pair.Key];

Check warning

Code scanning / InspectCode

Incorrect blank lines: Incorrect number of blank lines near braces Warning

Incorrect number of blank lines near braces, expected maximum 0 instead of 1
@wixoaGit wixoaGit merged commit 82693c1 into OpenDreamProject:master Dec 11, 2024
7 checks passed
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/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants