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

Bigint constants #3050

Merged
merged 5 commits into from
Sep 21, 2023
Merged

Bigint constants #3050

merged 5 commits into from
Sep 21, 2023

Conversation

jochem-brouwer
Copy link
Member

This PR:

  • Caches most (not all) constants of BigInts monorepo-wide
  • Caches ALL constants in EVM
  • The monorepo-wide constants are now exported from util

Note: please review #3034 first (and merge in master if OK, or merge this on top if OK and then merge into master)

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #3050 (53b3b6a) into master (aaa5de6) will decrease coverage by 0.09%.
The diff coverage is 79.61%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.78% <88.57%> (+0.05%) ⬆️
blockchain 92.61% <95.23%> (+0.02%) ⬆️
client 87.46% <88.02%> (-0.27%) ⬇️
common 98.19% <100.00%> (+<0.01%) ⬆️
ethash ∅ <ø> (∅)
evm 71.87% <59.50%> (+0.20%) ⬆️
rlp ∅ <ø> (∅)
statemanager 90.15% <ø> (ø)
trie 90.34% <ø> (+0.03%) ⬆️
tx 96.36% <100.00%> (+0.01%) ⬆️
util 86.97% <94.87%> (+0.09%) ⬆️
vm 78.12% <62.50%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@holgerd77
Copy link
Member

Great stuff, thanks for taking this one step further! 🙏

Looks generally great and good to merge from my side (won’t do myself since I opened the initial PR, would be great if someone else could take upon that). Some tests still failing though.

@holgerd77
Copy link
Member

Updated both the base branch and this branch and resolved a merge conflict, since I wanted to get the latest DB-layout (storage trie prefix) changes in to be able to run the profiler on this and compare.

@holgerd77
Copy link
Member

Puh puh puh.

It is so hard to get reliable deterministic results, I know realized that having two different CLI tabs (one with the PR and one with master and switching between them) might/seems also to influence performance since the OS might assign different ressources (?) to the specific tab or something. 🤔

I've now switched to staying in one tab and getting the different full paths with the Linux pwd command and then running cd FULL_PATH_PR && npm run client:start ... and cd FULL_PATH_MASTER && npm run client:start ...(having a copied repository there) in alternation, that seems to produce the most "honest" results to me.

Just "live-writing" down the results here, I am not sure yet if they show some clear trend:

Running npm run client:start -- --sync=none --vmProfileBlocks --executeBlocks=2005567-2005590 in the way above and then again looking at the last block and noting here the BpS value (already totally fluent in our new terminology 😂):

PR : 11.32. 10.16. 9.613. 14.971. 15.277. 9.521. 15.092. 10.277
Master : 9.651. 10.23. 10.07. 10.463. 9.971. 16.087. 15.641. 10.241

For some reasons GitHub sometimes thinks to auto-insert a dot after these numbers makes sense, I'll leave it there.

Hmm. So these results are so utterly diverse, I guess one can't just read anything out of this.

I'll run the same command as above but compare the on one block (number) lower (so 2005589):

PR. : 32.583. 32.516. 31.984. 32.448. 30.251. 31.406. 32.788. 31.789
Master : 30.077. 31.789. 29.79. 30.251. 31.66. 31.596. 32.448. 31.853

Ok. Better.

Interesting that some blocks are so diverse.

Hmm. I guess one can't completely say for sure nevertheless if this improves things or not out of this results. Slight tendency eventually that it does.

So my conclusion would be somewhat: safe enough to say that this doesn't worsen things and likely enough that this somewhat improve things that we can merge. 🙂

@jochem-brouwer jochem-brouwer marked this pull request as ready for review September 21, 2023 09:37
@acolytec3 acolytec3 changed the base branch from evm-bigint-consts-and-small-arithmetic-optimizations to master September 21, 2023 13:39
acolytec3
acolytec3 previously approved these changes Sep 21, 2023
Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

LGTM. Going ahead and approving pending CI (though not sure if all will pass).

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

LGTM

@holgerd77 holgerd77 merged commit d6d4b80 into master Sep 21, 2023
@holgerd77 holgerd77 deleted the bigint-constants branch September 21, 2023 15:49
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.

3 participants