Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Problem: deep context stack efficienty is not benchmarked #627

Merged
merged 5 commits into from
Oct 6, 2021

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Oct 6, 2021

Closes: #626

Solution:

  • add a benchmark to demonstrate an extremely inefficiency in deep
    context stack

Local results:

goos: darwin
goarch: amd64
pkg: github.com/tharsis/ethermint/x/evm/keeper
cpu: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
BenchmarkDeepContextStack1
BenchmarkDeepContextStack1-16     	   78386	     15129 ns/op
BenchmarkDeepContextStack10
BenchmarkDeepContextStack10-16    	       6	 197417316 ns/op
BenchmarkDeepContextStack13
BenchmarkDeepContextStack13-16    	       1	14055459159 ns/op
PASS
ok  	github.com/tharsis/ethermint/x/evm/keeper	19.793s

In a real world case, the context stack depth is 34.

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Closes: evmos#626

Solution:
- add a benchmark to demonstrate an extremely inefficiency in deep
  context stack
@fedekunze fedekunze enabled auto-merge (squash) October 6, 2021 11:28
@fedekunze fedekunze merged commit 78c8ceb into evmos:main Oct 6, 2021
@yihuang yihuang deleted the benchmark-context-stack branch October 6, 2021 13:25
fedekunze added a commit that referenced this pull request Oct 7, 2021
* Problem: deep context stack efficienty is not benchmarked

Closes: #626

Solution:
- add a benchmark to demonstrate an extremely inefficiency in deep
  context stack

* Update x/evm/keeper/benchmark_test.go

* prefix storage is irrelevant

* add comment to state_transition.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
fedekunze added a commit that referenced this pull request Oct 7, 2021
* docs: v0.6.0 changelog (#605) (#606)

* docs: v0.6.0 changelog

* update codeowners

* build(deps): bump github.com/cosmos/cosmos-sdk from 0.44.0 to 0.44.1 (#610)

* build(deps): bump github.com/cosmos/cosmos-sdk from 0.44.0 to 0.44.1

Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.44.0 to 0.44.1.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.44.1/CHANGELOG.md)
- [Commits](cosmos/cosmos-sdk@v0.44.0...v0.44.1)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* changelog

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>

* cmd: use config on genaccounts (#483)

* cmd: use config on genaccounts

* update

* c++

* rpc: fix panic (#611)

* rpc: fix panic

* fix

* c++

* rpc: restructure JSON-RPC directory and rename server config (#612)

* Restructure ethermint/rpc repo structure and change import statements

* Add #400 to changelog

* fix filepath in util and json_rpc

* Move #400  to unreleased section

* evm: refactor `traceTx` (#613)

* DNM: debug traceTx

* c++

* deps: bump IBC-go (#621)

* deps: bump IBC-go

* changelog

* evm, rpc:  fix tx log attribute value is not parsable by some client (#615)

* Problem: tx log attribute value not parsable by some client

Closes: #614

Solution:
- encode the value to json string rather than bytes

Apply suggestions from code review

* rm cdc and changelog

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>

* evm: fix iterator on deeply nested cache contexts (#617)

* Problem: iterator on deeply nested cache contexts is extremely slow

Closes: #616

Solution:
- flatten cache contexts before doing `GetTxLogsTransient`

* Update x/evm/keeper/context_stack.go

* changelog

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>

* evm: add benchmark for deep context stack (#627)

* Problem: deep context stack efficienty is not benchmarked

Closes: #626

Solution:
- add a benchmark to demonstrate an extremely inefficiency in deep
  context stack

* Update x/evm/keeper/benchmark_test.go

* prefix storage is irrelevant

* add comment to state_transition.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* rpc: support personal apis with different keyring backends (#591)

* UPDATE Unlock keyring on start

* ADD comment

* ADD validation

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* conflicts

* changelog

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Burckhardt <daniel.m.burckhardt@gmail.com>
Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: davcrypto <88310031+davcrypto@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Follow up tracking issue on deep context stack efficiency
2 participants