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

use List instead of WordStack for wordStack cell #2364

Closed
wants to merge 12 commits into from
Closed

Conversation

dwightguth
Copy link
Collaborator

A sizeable amount of time is being spent computing the size of the word stack cell on every opcode. This is less than ideal because the wordStack cell is just a stack and therefore ought to have push, pop, and length operations in constant time. However, this is not really achievable with the cons implementation of the stack.

We replace the WordStack sort as it is being used by the wordStack cell with the List sort. This improves performance somewhat, but a lot of time is still being spent pushing elements onto the list, because this operation, implemented naively, consists of constructing a new list with one element and appending them together.

We therefore make use of the pushList operator defined in recent versions of the K prelude to get significantly superior performance for pushing elements onto the stack. With this change, stack operations like push, pop, and length, are observed to occupy almost no time within the time profile.

@dwightguth dwightguth force-pushed the wordstack branch 8 times, most recently from 05068f2 to 6ee5133 Compare March 26, 2024 17:53
@dwightguth dwightguth force-pushed the wordstack branch 2 times, most recently from f1f2ed0 to 67b3c78 Compare March 26, 2024 19:51
@dwightguth dwightguth force-pushed the wordstack branch 2 times, most recently from d03895a to 9f5e1e4 Compare March 28, 2024 20:49
@dwightguth dwightguth closed this Apr 8, 2024
dwightguth pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Apr 16, 2024
dwightguth pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Jun 17, 2024
dwightguth pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Jun 18, 2024
dwightguth pushed a commit that referenced this pull request Jun 18, 2024
dwightguth pushed a commit that referenced this pull request Jun 25, 2024
Robertorosmaninho pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Jul 5, 2024
Robertorosmaninho pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Jul 9, 2024
Robertorosmaninho pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Jul 9, 2024
dwightguth pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Jul 9, 2024
Robertorosmaninho pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Aug 7, 2024
Robertorosmaninho pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Aug 13, 2024
Robertorosmaninho pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Sep 12, 2024
dwightguth pushed a commit to Pi-Squared-Inc/evm-semantics that referenced this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant