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

Further optimize performances and behavior of SMTs #75

Open
DanieleDiBenedetto opened this issue Oct 8, 2020 · 0 comments
Open

Further optimize performances and behavior of SMTs #75

DanieleDiBenedetto opened this issue Oct 8, 2020 · 0 comments
Labels
enhancement New feature or request optimization Performance improvement for the current codebase

Comments

@DanieleDiBenedetto
Copy link
Collaborator

DanieleDiBenedetto commented Oct 8, 2020

Based on the following timings (taken on my CPU 6x2.2GHz (turbo 4.1GHz), 8GB RAM):

process_leaves_mnt4_comp
--Add 1000 leaves in a tree of height 23:
---Non-Lazy: 91.6s
---Lazy: 0.423s
--Remove 1000 leaves in a tree of height 23:
---Non-Lazy: 28.7s
---Lazy: 0.343s

Single leaf updates to a BigMerkleTree are still quite slow.
Of course if we move away from the huge base field size of the MNT curves and an "inverse S-Box"-based Poseidon Hash, timings will be much much better; still this suggests the possibility to do some further optimizations like properly tuning DB parameters, reducing accesses to DB by means of additional in-memory data structures and so on;

Moreover, right now, the only way to recover a BigMerkleTree and a BigLazyMerkleTree due to an exceptional situation (like a crash or an external cause), is taking the leaves from the DB and rebuild the tree by re-adding the leaves.
Even if this can be done much quicker using a BigLazyMerkleTree, this suggests the need to provide some optimized persistency mechanism with the additional requirement of consistency.

Investigate both.

@DanieleDiBenedetto DanieleDiBenedetto added enhancement New feature or request optimization Performance improvement for the current codebase labels Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request optimization Performance improvement for the current codebase
Projects
None yet
Development

No branches or pull requests

1 participant