Skip to content

Commit

Permalink
chore: add benchmarks (#18)
Browse files Browse the repository at this point in the history
* chore: benchmarks

* chore: add outputs
  • Loading branch information
rymnc authored Jun 19, 2024
1 parent 97a5b06 commit 1b268db
Show file tree
Hide file tree
Showing 1,224 changed files with 224,065 additions and 6 deletions.
500 changes: 498 additions & 2 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ clean:

example:
@cargo run --release -p stealth_address_kit_example

bench:
@cargo bench --all-features
cp -r target/criterion/** benchmarks/
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ The following curves are currently supported:
8. `bw6_761`
9. `baby_jub_jub`

## Benchmarks

See the [benchmarks](./benchmarks/report/index.html) for performance comparisons across supported curves.

## Usage Example

Below is an example demonstrating how to use the Stealth Address Kit with the `ark_bn254` curve:
Expand Down Expand Up @@ -55,6 +59,7 @@ To add support for a new curve, follow these steps:
5. Add the curve to the `lib.rs` file in the `mod` declaration, and re-export if required.
6. Update the README to include the new curve.
7. Add the curve to the nightly release workflow.
8. Add the curve to the benchmarks.

## Building and Testing

Expand All @@ -74,6 +79,16 @@ To run tests, use the following command:
cargo test --release --features <bn254/bls12_381/bls12_377/secp256k1/secp256r1/etc>
```

### Benchmarks

To run benchmarks, use the following command:

```sh
make bench
```

This will run benchmarks for all supported curves, and output the results to the `benchmarks` directory.

## FFI API

The exposed FFI API supports all curves, prefixed by the curve name. Ensure that the correct feature is enabled when building the library.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"group_id":"babyjubjub","function_id":"compute_shared_point","value_str":null,"throughput":null,"full_id":"babyjubjub/compute_shared_point","directory_name":"babyjubjub/compute_shared_point","title":"babyjubjub/compute_shared_point"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mean":{"confidence_interval":{"confidence_level":0.95,"lower_bound":97319.5643622821,"upper_bound":97438.79590722626},"point_estimate":97372.71293406669,"standard_error":30.635992245045504},"median":{"confidence_interval":{"confidence_level":0.95,"lower_bound":97290.04902962207,"upper_bound":97337.89103803998},"point_estimate":97312.11139860141,"standard_error":10.919156953233601},"median_abs_dev":{"confidence_interval":{"confidence_level":0.95,"lower_bound":87.78442155083499,"upper_bound":165.90222767665645},"point_estimate":119.3279698562523,"standard_error":19.788689130786626},"slope":{"confidence_interval":{"confidence_level":0.95,"lower_bound":97267.82676107953,"upper_bound":97313.97690550273},"point_estimate":97289.86105350834,"standard_error":11.75922819598919},"std_dev":{"confidence_interval":{"confidence_level":0.95,"lower_bound":145.57935245383402,"upper_bound":441.25979203762444},"point_estimate":308.03526582847746,"standard_error":78.89442484176894}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sampling_mode":"Linear","iters":[11.0,22.0,33.0,44.0,55.0,66.0,77.0,88.0,99.0,110.0,121.0,132.0,143.0,154.0,165.0,176.0,187.0,198.0,209.0,220.0,231.0,242.0,253.0,264.0,275.0,286.0,297.0,308.0,319.0,330.0,341.0,352.0,363.0,374.0,385.0,396.0,407.0,418.0,429.0,440.0,451.0,462.0,473.0,484.0,495.0,506.0,517.0,528.0,539.0,550.0,561.0,572.0,583.0,594.0,605.0,616.0,627.0,638.0,649.0,660.0,671.0,682.0,693.0,704.0,715.0,726.0,737.0,748.0,759.0,770.0,781.0,792.0,803.0,814.0,825.0,836.0,847.0,858.0,869.0,880.0,891.0,902.0,913.0,924.0,935.0,946.0,957.0,968.0,979.0,990.0,1001.0,1012.0,1023.0,1034.0,1045.0,1056.0,1067.0,1078.0,1089.0,1100.0],"times":[1091125.0,2142750.0,3211458.0,4307417.0,5350875.0,6424333.0,7511292.0,8731292.0,9681709.0,10757334.0,11820167.0,12855459.0,13892375.0,15004667.0,16131167.0,17167666.0,18205958.0,19296000.0,20350792.0,21391459.0,22486750.0,23526292.0,24579417.0,25727125.0,26806791.0,27848708.0,28872667.0,29979959.0,30979625.0,32052125.0,33130000.0,34334167.0,35318708.0,36335708.0,37376625.0,38548208.0,39577917.0,40693834.0,41691583.0,42777208.0,43964625.0,45055583.0,46051417.0,47113459.0,48283625.0,49454084.0,50287417.0,51373208.0,52457375.0,53497500.0,54632709.0,55717292.0,56737125.0,57806875.0,58876083.0,59984666.0,60947541.0,62283125.0,63117083.0,64393875.0,65290000.0,66292875.0,67472208.0,68655834.0,69578667.0,70610792.0,71713542.0,72637125.0,73888042.0,74850667.0,75891916.0,77099791.0,77975666.0,79336500.0,80160208.0,81303041.0,82383666.0,83380083.0,84522334.0,85510458.0,86610958.0,87770334.0,88708625.0,89924834.0,90905125.0,92052333.0,93057750.0,94200916.0,95246958.0,96257500.0,97381291.0,98339791.0,99528125.0,100646875.0,101608959.0,102885542.0,103784292.0,104890625.0,105902167.0,107042542.0]}
1 change: 1 addition & 0 deletions benchmarks/babyjubjub/compute_shared_point/base/tukey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[96754.72124534822,96993.63046584264,97630.72172049442,97869.63094098883]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"group_id":"babyjubjub","function_id":"compute_shared_point","value_str":null,"throughput":null,"full_id":"babyjubjub/compute_shared_point","directory_name":"babyjubjub/compute_shared_point","title":"babyjubjub/compute_shared_point"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mean":{"confidence_interval":{"confidence_level":0.95,"lower_bound":97319.5643622821,"upper_bound":97438.79590722626},"point_estimate":97372.71293406669,"standard_error":30.635992245045504},"median":{"confidence_interval":{"confidence_level":0.95,"lower_bound":97290.04902962207,"upper_bound":97337.89103803998},"point_estimate":97312.11139860141,"standard_error":10.919156953233601},"median_abs_dev":{"confidence_interval":{"confidence_level":0.95,"lower_bound":87.78442155083499,"upper_bound":165.90222767665645},"point_estimate":119.3279698562523,"standard_error":19.788689130786626},"slope":{"confidence_interval":{"confidence_level":0.95,"lower_bound":97267.82676107953,"upper_bound":97313.97690550273},"point_estimate":97289.86105350834,"standard_error":11.75922819598919},"std_dev":{"confidence_interval":{"confidence_level":0.95,"lower_bound":145.57935245383402,"upper_bound":441.25979203762444},"point_estimate":308.03526582847746,"standard_error":78.89442484176894}}
1 change: 1 addition & 0 deletions benchmarks/babyjubjub/compute_shared_point/new/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sampling_mode":"Linear","iters":[11.0,22.0,33.0,44.0,55.0,66.0,77.0,88.0,99.0,110.0,121.0,132.0,143.0,154.0,165.0,176.0,187.0,198.0,209.0,220.0,231.0,242.0,253.0,264.0,275.0,286.0,297.0,308.0,319.0,330.0,341.0,352.0,363.0,374.0,385.0,396.0,407.0,418.0,429.0,440.0,451.0,462.0,473.0,484.0,495.0,506.0,517.0,528.0,539.0,550.0,561.0,572.0,583.0,594.0,605.0,616.0,627.0,638.0,649.0,660.0,671.0,682.0,693.0,704.0,715.0,726.0,737.0,748.0,759.0,770.0,781.0,792.0,803.0,814.0,825.0,836.0,847.0,858.0,869.0,880.0,891.0,902.0,913.0,924.0,935.0,946.0,957.0,968.0,979.0,990.0,1001.0,1012.0,1023.0,1034.0,1045.0,1056.0,1067.0,1078.0,1089.0,1100.0],"times":[1091125.0,2142750.0,3211458.0,4307417.0,5350875.0,6424333.0,7511292.0,8731292.0,9681709.0,10757334.0,11820167.0,12855459.0,13892375.0,15004667.0,16131167.0,17167666.0,18205958.0,19296000.0,20350792.0,21391459.0,22486750.0,23526292.0,24579417.0,25727125.0,26806791.0,27848708.0,28872667.0,29979959.0,30979625.0,32052125.0,33130000.0,34334167.0,35318708.0,36335708.0,37376625.0,38548208.0,39577917.0,40693834.0,41691583.0,42777208.0,43964625.0,45055583.0,46051417.0,47113459.0,48283625.0,49454084.0,50287417.0,51373208.0,52457375.0,53497500.0,54632709.0,55717292.0,56737125.0,57806875.0,58876083.0,59984666.0,60947541.0,62283125.0,63117083.0,64393875.0,65290000.0,66292875.0,67472208.0,68655834.0,69578667.0,70610792.0,71713542.0,72637125.0,73888042.0,74850667.0,75891916.0,77099791.0,77975666.0,79336500.0,80160208.0,81303041.0,82383666.0,83380083.0,84522334.0,85510458.0,86610958.0,87770334.0,88708625.0,89924834.0,90905125.0,92052333.0,93057750.0,94200916.0,95246958.0,96257500.0,97381291.0,98339791.0,99528125.0,100646875.0,101608959.0,102885542.0,103784292.0,104890625.0,105902167.0,107042542.0]}
1 change: 1 addition & 0 deletions benchmarks/babyjubjub/compute_shared_point/new/tukey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[96754.72124534822,96993.63046584264,97630.72172049442,97869.63094098883]
Loading

0 comments on commit 1b268db

Please sign in to comment.