-
Notifications
You must be signed in to change notification settings - Fork 1k
Optimize VM hot paths and add targeted benchmarks #4230
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
base: dev
Are you sure you want to change the base?
Conversation
| var length = end - start; | ||
| if (length == 0) | ||
| return System.Array.Empty<StackItem>(); | ||
|
|
||
| return reverseList.GetRange(start, end - start); | ||
| StackItem[] result = new StackItem[length]; | ||
| var sourceIndex = _innerList.Count - start - 1; | ||
| for (int i = 0; i < length; i++) | ||
| result[i] = _innerList[sourceIndex - i]; | ||
|
|
||
| return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this back there is a good reason why I wrote it the way I did. Can you explain your reasoning why you changed it? This way uses a loop. So, having big lists of data, you'll see performance issues come up. You guys tried to change it this way before.
We talked about it in a meeting about why its written this way from #4050
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a draft, do not review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saying it so your aware of what your doing. I want you to succeed.
src/Neo.VM/EvaluationStack.cs
Outdated
| for (int i = 0; i < _innerList.Count; i++) | ||
| stack._innerList.Add(_innerList[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These loops are so inefficient.
|
Why are all the PRs you submitted marked as WIP/Draft? |
Summary
Testing
Benchmark comparison (mean)