Skip to content

PersistedSmtForest#645

Draft
gswirski wants to merge 5 commits into0xMiden:nextfrom
reilabs:gs/smt-forest-perm
Draft

PersistedSmtForest#645
gswirski wants to merge 5 commits into0xMiden:nextfrom
reilabs:gs/smt-forest-perm

Conversation

@gswirski
Copy link
Collaborator

@gswirski gswirski commented Nov 8, 2025

Draft PR to explore persistent SmtForest version.

LargeSmt baseline

Running benchmark with rocksdb storage
Benchmarking LargeSmt implementation
Running a construction benchmark:
Using database path: /var/folders/h4/sk46p_vd4_7fwnwr9989wz4c0000gn/T/miden_crypto_benchmark
Constructed an SMT with 100000 key-value pairs in 2.1 seconds
Number of leaf nodes: 100000

Running an insertion benchmark:
The average insertion time measured by 10000 inserts into an SMT with 100000 leaves is 355 μs

Running a batched insertion benchmark:
The average insert-batch computation time measured by a 10000-batch into an SMT with 110000 leaves over 203.3 ms is 20 μs
The average insert-batch application time measured by a 10000-batch into an SMT with 110000 leaves over 147.2 ms is 15 μs
The average batch insertion time measured by a 10000-batch into an SMT with 110000 leaves totals to 350.5 ms

Running a batched update benchmark:
The average update-batch computation time measured by a 10000-batch into an SMT with 120000 leaves over 205.7 ms is 21 μs
The average update-batch application time measured by a 10000-batch into an SMT with 120000 leaves over 144.6 ms is 14 μs
The average batch update time measured by a 10000-batch into an SMT with 120000 leaves totals to 350.3 ms

Running a proof generation benchmark:
The average proving time measured by 100 value proofs in an SMT with 117982 leaves in 8 μs
Benchmark completed successfully

Naive implementation

Each node hash stored as a key in rocksdb.

  • creation: 17x slower
  • batch insert: 13x slower
  • batch update: 13x slower
  • proof generation: 20x slower
Running `target/release/miden-crypto --storage rocksdb --size 100000 --tree persisted-forest`
Running benchmark with rocksdb storage
Benchmarking PersistedSmtForest implementation
Running a construction benchmark:
Using forest database path: /var/folders/h4/sk46p_vd4_7fwnwr9989wz4c0000gn/T/miden_crypto_persisted_forest_benchmark
Constructed an SMT with 100000 key-value pairs in 35.0 seconds
Number of leaf nodes: 100000

Running an insertion benchmark:
The average insertion time measured by 10000 inserts into an SMT with 100000 leaves is 537 μs

Running a batched insertion benchmark:
The average insert-batch execution time measured by a 10000-batch into an SMT with 110000 leaves over 4638.4 ms is 464 μs
The average batch insertion time measured by a 10000-batch into an SMT with 110000 leaves totals to 4638.4 ms

Running a batched update benchmark:
The average update-batch execution time measured by a 10000-batch into an SMT with 120000 leaves over 4454.8 ms is 445 μs
The average batch update time measured by a 10000-batch into an SMT with 120000 leaves totals to 4454.8 ms

Running a proof generation benchmark:
The average proving time measured by 100 value proofs in an SMT with 117996 leaves in 201 μs
Benchmark completed successfully

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.

1 participant