# ignacio (jsign) - Update 10 In my previous update, I've created a benchmark that compares face to face inserting 1k, 5k and 10k key-values in an in-memory Merkle Patricia Trie and Verkle Trie. The strategy is to start moving to more end to end benchmarks to keep finding optimization opportunities. In this case, I made changes in the three layers: - `go-ethereum`: https://github.com/gballet/go-ethereum/pull/147 - `go-verkle`: https://github.com/gballet/go-verkle/pull/314 - `go-ipa`: https://github.com/crate-crypto/go-ipa/pull/31 In `go-ethereum` all three combined changes had the following impact in a 16 core machine: ``` name old time/op new time/op delta TriesRandom/VKT/1000_accounts-16 63.1ms ± 4% 20.8ms ± 3% -67.10% (p=0.000 n=19+10) TriesRandom/VKT/5000_accounts-16 279ms ± 4% 67ms ± 1% -75.83% (p=0.000 n=19+9) TriesRandom/VKT/10000_accounts-16 562ms ± 2% 128ms ± 1% -77.15% (p=0.000 n=20+9) name old alloc/op new alloc/op delta TriesRandom/VKT/1000_accounts-16 9.49MB ± 0% 3.57MB ± 0% -62.39% (p=0.000 n=20+10) TriesRandom/VKT/5000_accounts-16 43.5MB ± 0% 13.0MB ± 0% -70.15% (p=0.000 n=20+10) TriesRandom/VKT/10000_accounts-16 87.4MB ± 0% 26.3MB ± 0% -69.93% (p=0.000 n=20+10) name old allocs/op new allocs/op delta TriesRandom/VKT/1000_accounts-16 32.8k ± 0% 35.5k ± 0% +8.05% (p=0.000 n=20+10) TriesRandom/VKT/5000_accounts-16 151k ± 0% 144k ± 0% -4.90% (p=0.000 n=20+10) TriesRandom/VKT/10000_accounts-16 303k ± 0% 285k ± 0% -5.98% (p=0.000 n=20+10) ``` In summary, around ~75% performance improvement (4.4x speedup) in the refernece benchmarks. The performance improvement scales with the number of cores in the machine. This was ran less powerful setups with [good results too](https://gist.github.com/jsign/e064a7a96e762f6e4729a666b4b86bec). These changes also had promising results in paths that we didn't focus optimizing but since they use the same underlying code paths, we got other gains "for free". For example, [in the `ProofCalculation` benchmark in `go-verkle`](https://github.com/gballet/go-verkle/pull/314): ``` name old time/op new time/op delta ProofCalculation-16 1.87s ± 2% 0.08s ± 3% -95.75% (p=0.003 n=5+7) ``` None of the PRs are meregd yet. There were many changes that already had a pass of review from Guillaume. We've decided to [wait for other PR that is baking in `go-verkle`](https://github.com/gballet/go-verkle/pull/295) since that can affect some changes that I did in this PR, so we want to see after how we reorganize this work. Guillaume will be OOO for some weeks, so we'll freeze a bit this work direction until he's back. I already have plans on working on a different direction resuming some chat I had with Dankrad some weeks ago, so this I'm not blocked.