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

EVM memory extend is very slow. #1591

Closed
jangko opened this issue May 30, 2023 · 1 comment · Fixed by #1592
Closed

EVM memory extend is very slow. #1591

jangko opened this issue May 30, 2023 · 1 comment · Fixed by #1592

Comments

@jangko
Copy link
Contributor

jangko commented May 30, 2023

proc extend*(memory: var Memory; startPos: Natural; size: Natural) =

This proc performance is very bad, especially concat operation contribute to the majority of time spent in EVM.

@mratsim
Copy link
Contributor

mratsim commented May 30, 2023

Seems like an easy optimization, replace all concat(repeat(0.byte, foo)) patterns by setLen.
This should reduce cost by atleast 2, probably 3 by avoiding all the intermediate allocations and more if it creates memory churn in the allocator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants