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

[Optimization] Parsing Smart Contract Script Analysis #3420

Merged
merged 11 commits into from
Jul 30, 2024

Conversation

cschuchardt88
Copy link
Member

@cschuchardt88 cschuchardt88 commented Jul 17, 2024

Change Log

  • Added VMInstruction class (faster than Instruction class)
  • Changed Parse command output format and colors.

image

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Local testing in terminal

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Jim8y
Copy link
Contributor

Jim8y commented Jul 18, 2024

a little bit explanation of how you achieved it would be great.

@cschuchardt88
Copy link
Member Author

a little bit explanation of how you achieved it would be great.

I don't follow. Code speak for itself?

@cschuchardt88 cschuchardt88 added the optimization Optmization issues label Jul 18, 2024
@Jim8y
Copy link
Contributor

Jim8y commented Jul 18, 2024

a little bit explanation of how you achieved it would be great.

I don't follow. Code speak for itself?

Not a request, its up to you. But i personally hate Code speak for itself?, it has made the project hard to maintain and hard to use already. Not saying yours is bad.

@Jim8y
Copy link
Contributor

Jim8y commented Jul 18, 2024

Sort of like, yes, we can have it, but not really necessary one, improvement might be 1 millisecond.

Jim8y
Jim8y previously approved these changes Jul 18, 2024
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

How much it optimizes? having two classes to parse an instruction seems like a usability cost to me, so I would like to know how much it optimizes, I think it would be better to optimize the Instruction class, since it is the one that is really usually used

@cschuchardt88
Copy link
Member Author

How much it optimizes? having two classes to parse an instruction seems like a usability cost to me, so I would like to know how much it optimizes, I think it would be better to optimize the Instruction class, since it is the one that is really usually used

Yes, I want to do change Instruction class to the one I made here, but isnt complete yet for all features of the Instruction class. But I guess I could complete it. instead of this pr.

@cschuchardt88 cschuchardt88 marked this pull request as draft July 23, 2024 08:57
@cschuchardt88 cschuchardt88 added blocked This issue can't be worked at the moment and removed waiting for review labels Jul 23, 2024
@cschuchardt88 cschuchardt88 marked this pull request as ready for review July 23, 2024 09:59
@cschuchardt88
Copy link
Member Author

cschuchardt88 commented Jul 23, 2024

Added more OpCode formatting

image
image

@cschuchardt88 cschuchardt88 requested a review from Jim8y July 23, 2024 10:39
@cschuchardt88 cschuchardt88 added waiting for review and removed blocked This issue can't be worked at the moment labels Jul 23, 2024
Jim8y
Jim8y previously approved these changes Jul 23, 2024
Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

Looks good to me, I will soon test

@shargon
Copy link
Member

shargon commented Jul 29, 2024

@cschuchardt88 please take a look to my last changes

@cschuchardt88
Copy link
Member Author

looks good

@NGDAdmin NGDAdmin merged commit ffb3100 into neo-project:master Jul 30, 2024
6 checks passed
@shargon shargon deleted the fix/neo-cli-parse-scripts branch July 30, 2024 06:57
Jim8y added a commit to Jim8y/neo that referenced this pull request Aug 1, 2024
* master:
  [Neo Core Add] add char support (neo-project#3441)
  [rpc] Extend `getversion` RPC response with additional protocol settings (neo-project#3443)
  update benchmark system (neo-project#3442)
  [`Optimization`] Parsing Smart Contract Script Analysis (neo-project#3420)
  `[Move]` Part-3 Classes into Different Library - `Neo.Extensions` (neo-project#3400)

# Conflicts:
#	benchmarks/Neo.Benchmarks/Benchmarks.POC.cs
#	benchmarks/Neo.VM.Benchmarks/Benchmarks.POC.cs
#	benchmarks/Neo.VM.Benchmarks/Program.cs
Jim8y added a commit to Jim8y/neo that referenced this pull request Aug 2, 2024
…ndardize-exception

* 'standardize-exception' of github.com:Jim8y/neo:
  Clean using
  [Neo Core Add] add char support (neo-project#3441)
  [rpc] Extend `getversion` RPC response with additional protocol settings (neo-project#3443)
  update benchmark system (neo-project#3442)
  [`Optimization`] Parsing Smart Contract Script Analysis (neo-project#3420)
  `[Move]` Part-3 Classes into Different Library - `Neo.Extensions` (neo-project#3400)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants