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

fix(rln): if only a single insertion, dont use batch_insert #215

Merged
merged 2 commits into from
Sep 14, 2023

Conversation

rymnc
Copy link
Contributor

@rymnc rymnc commented Sep 14, 2023

the batch_insert api is useful for multiple insertions while maintaining atomicity, but for single insertions, ruins performance - single insertions are atomic by
nature so this pr circumvents it.

@rymnc rymnc added the track:rln RLN Track - (Secure Messaging/Applied ZK), relay and applications label Sep 14, 2023
@rymnc rymnc self-assigned this Sep 14, 2023
@github-actions
Copy link

Benchmark for 58a46c8

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1396.0±51.80ns 1416.7±49.03ns +1.48%
FullMerkleTree::get 4.5±0.18ns 4.4±0.19ns -2.22%
FullMerkleTree::override_range 3.4±0.10µs 3.7±0.05µs +8.82%
FullMerkleTree::set 1417.7±37.42ns 1396.1±49.20ns -1.52%
OptimalMerkleTree::compute_root 1471.6±81.05ns 1512.0±53.12ns +2.75%
OptimalMerkleTree::delete 1412.5±63.63ns 1381.8±85.37ns -2.17%
OptimalMerkleTree::get 29.0±1.95ns 27.5±0.99ns -5.17%
OptimalMerkleTree::override_range 7.4±0.41µs 7.5±0.47µs +1.35%
OptimalMerkleTree::set 1579.1±96.59ns 1567.4±85.91ns -0.74%

@github-actions
Copy link

Benchmark for 58a46c8

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.7±0.00ns 1.7±0.00ns 0.00%
Pmtree::get 456.6±0.28ns 465.2±0.23ns +1.88%
Pmtree::override_range 177.5±6.44µs 188.3±18.24µs +6.08%
Pmtree::set 67.9±0.07µs 67.7±0.42µs -0.29%
Pmtree:delete 68.2±0.06µs 69.9±0.22µs +2.49%

@github-actions
Copy link

Benchmark for d527e22

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1317.8±93.48ns 1366.4±109.55ns +3.69%
FullMerkleTree::get 4.0±0.28ns 4.2±0.25ns +5.00%
FullMerkleTree::override_range 3.3±0.20µs 3.3±0.16µs 0.00%
FullMerkleTree::set 1359.7±82.41ns 1366.2±120.18ns +0.48%
OptimalMerkleTree::compute_root 1578.1±124.44ns 1521.7±99.38ns -3.57%
OptimalMerkleTree::delete 1598.9±100.26ns 1453.3±116.16ns -9.11%
OptimalMerkleTree::get 32.2±2.30ns 31.7±3.05ns -1.55%
OptimalMerkleTree::override_range 7.8±0.71µs 8.1±0.63µs +3.85%
OptimalMerkleTree::set 1521.6±93.59ns 1387.2±92.57ns -8.83%

@github-actions
Copy link

Benchmark for d527e22

Click to view benchmark
Test Base PR %
Pmtree::compute_root 2.0±0.02ns 2.4±0.02ns +20.00%
Pmtree::get 562.2±2.58ns 555.7±6.02ns -1.16%
Pmtree::override_range 207.9±16.55µs 212.0±24.37µs +1.97%
Pmtree::set 80.9±0.47µs 82.3±1.04µs +1.73%
Pmtree:delete 81.0±0.58µs 82.8±1.07µs +2.22%

@rymnc rymnc merged commit f73c83b into master Sep 14, 2023
16 checks passed
@rymnc rymnc deleted the if-single-insertion branch September 14, 2023 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
track:rln RLN Track - (Secure Messaging/Applied ZK), relay and applications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant