Gas cost
The insertions of the new implementation are cheaper initially, then get closer to the old version as it grows.
Insert (1) | Insert (100) | Insert (200) | Insert (500) | Update (1) | Remove (1) | Deployment | |
---|---|---|---|---|---|---|---|
Old Mekrle tree | 1098014 |
514772 |
510467 |
506582 |
794762 |
793419 |
1834586 |
New Merkle tree | 96335 |
187326 |
206016 |
234121 |
192765 |
192508 |
663315 |
If you want to run the benchmarks yourself install the dependencies with yarn
in the solidity
folder and then run yarn test:report-gas
.