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

trie: Restacktrie factor leaf+ext and hash forked leaves #15

Merged
merged 1 commit into from
Apr 27, 2020

Conversation

gballet
Copy link

@gballet gballet commented Apr 1, 2020

This is a quick refactoring to make the leaf and extension case look a bit the same for further code cleanup and simplify the optimization work.

It also introduces an optimization that I had overlooked: when inserting a key into a key node, it will directly hash the previous key. This slightly reduces the number of allocations on the 10K benchmark.

@holiman holiman merged commit f4b7ec6 into holiman:trie_gen Apr 27, 2020
holiman pushed a commit that referenced this pull request Nov 26, 2022
By avoiding ssz merklelization, we significantly reduce the latency of generating FS
challenges.

Before:
```
BenchmarkVerifyMultiple/8-6           16          69890960 ns/op        25221325 B/op     399904 allocs/op
BenchmarkVerifyMultiple/16-6                   8         138506286 ns/op        50439658 B/op     799792 allocs/op
```

After:
```
BenchmarkVerifyMultiple/8-6 	      27	  41349482 ns/op	22059083 B/op	  301451 allocs/op
BenchmarkVerifyMultiple/16-6         	      14	  80868200 ns/op	44114668 B/op	  602909 allocs/op
```
holiman pushed a commit that referenced this pull request Mar 18, 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.

2 participants