forked from anoma/ferveo
-
Notifications
You must be signed in to change notification settings - Fork 10
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
WASM bindings #10
Merged
piotr-roslaniec
merged 17 commits into
nucypher:main
from
piotr-roslaniec:wasm-bindings
Nov 22, 2022
Merged
WASM bindings #10
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ca2e46e
add wasm setup
piotr-roslaniec 1b96071
setup benchmarks
piotr-roslaniec 9fc2c4b
add bindings for threshold decryption flow
piotr-roslaniec 2462c8a
fix clippy
piotr-roslaniec 7e92e0d
self review
piotr-roslaniec b8b2392
update after rebase
piotr-roslaniec d8b51ce
expose randomness in dkg setup
piotr-roslaniec f93c6d5
add wasm setup
piotr-roslaniec 71ae0c3
add bindings for threshold decryption flow
piotr-roslaniec d80d112
fix clippy
piotr-roslaniec 9d358e1
panicks at 'capacity overflow' during js-benches
piotr-roslaniec d77f3b7
update after rebase
piotr-roslaniec 1688c36
add benchmarks in the browser
piotr-roslaniec c0c2c9e
add info about benchmark setup
piotr-roslaniec 0091ae1
add python bindings and benchmark
piotr-roslaniec 227052a
Merge pull request #18 from nucypher/bindings-python
piotr-roslaniec 85fba9e
Merge pull request #17 from nucypher/benchmark-wasm
piotr-roslaniec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/target | ||
target | ||
*.wasm |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# WASM results | ||
|
||
``` | ||
TPKE/share_combine: 100 validators threshold 1024*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [203.07 ms 203.63 ms 204.31 ms] | ||
TPKE/share_combine: 100 validators threshold 2048*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [202.04 ms 202.49 ms 203.37 ms] | ||
TPKE/share_combine: 100 validators threshold 4096*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [201.94 ms 202.74 ms 203.32 ms] | ||
TPKE/share_combine: 100 validators threshold 8192*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [194.89 ms 195.44 ms 196.43 ms] | ||
TPKE/share_combine: 150 validators threshold 1024*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [291.00 ms 291.93 ms 292.94 ms] | ||
TPKE/share_combine: 150 validators threshold 2048*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [287.92 ms 291.28 ms 293.63 ms] | ||
TPKE/share_combine: 150 validators threshold 4096*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [291.20 ms 291.94 ms 292.61 ms] | ||
TPKE/share_combine: 150 validators threshold 8192*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [292.36 ms 293.98 ms 295.60 ms] | ||
TPKE/share_combine: 200 validators threshold 1024*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [429.51 ms 431.92 ms 434.20 ms] | ||
TPKE/share_combine: 200 validators threshold 2048*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [427.99 ms 429.13 ms 430.25 ms] | ||
TPKE/share_combine: 200 validators threshold 4096*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [428.54 ms 429.52 ms 430.93 ms] | ||
TPKE/share_combine: 200 validators threshold 8192*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [413.68 ms 426.59 ms 434.22 ms] | ||
``` | ||
|
||
# Rust results | ||
``` | ||
TPKE/share_combine: 100 validators threshold 1024*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [39.402 ms 39.933 ms 40.442 ms] | ||
change: [-78.967% -78.479% -78.003%] (p = 0.00 < 0.05) | ||
TPKE/share_combine: 100 validators threshold 2048*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [36.905 ms 37.714 ms 38.555 ms] | ||
change: [-79.026% -78.298% -77.409%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 100 validators threshold 4096*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [38.335 ms 39.103 ms 40.138 ms] | ||
change: [-79.030% -78.666% -78.289%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 100 validators threshold 8192*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [37.560 ms 39.477 ms 41.840 ms] | ||
change: [-78.908% -78.079% -77.420%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 150 validators threshold 1024*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [59.445 ms 60.015 ms 60.918 ms] | ||
change: [-77.813% -77.500% -77.138%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 150 validators threshold 2048*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [57.400 ms 58.897 ms 59.917 ms] | ||
change: [-79.208% -78.475% -77.800%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 150 validators threshold 4096*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [55.343 ms 56.937 ms 59.751 ms] | ||
change: [-79.182% -78.302% -77.213%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 150 validators threshold 8192*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [58.516 ms 59.499 ms 60.542 ms] | ||
change: [-79.088% -78.442% -77.787%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 200 validators threshold 1024*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [78.889 ms 79.303 ms 79.871 ms] | ||
change: [-79.477% -78.764% -78.196%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 200 validators threshold 2048*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [78.631 ms 79.323 ms 79.960 ms] | ||
change: [-78.776% -78.250% -77.742%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 200 validators threshold 4096*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [76.580 ms 77.272 ms 78.058 ms] | ||
change: [-78.700% -78.253% -77.767%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
TPKE/share_combine: 200 validators threshold 8192*2/3 - #msg 1 - msg-size = 100 bytes | ||
time: [76.676 ms 77.459 ms 78.123 ms] | ||
change: [-80.315% -79.559% -78.876%] (p = 0.00 < 0.05) | ||
Performance has improved. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# tpke | ||
|
||
## Benchmarking WASM | ||
|
||
Based on `centurion.rs` (docs)[https://github.com/bheisler/criterion.rs/blob/version-0.4/book/src/user_guide/wasi.md#webasseblywasi-benchmarking] | ||
|
||
### Setup | ||
|
||
```bash | ||
cargo install cargo-wasi | ||
npm install -g @wasmer/cli | ||
|
||
cargo wasi build --bench=benchmarks --release | ||
cp `ls -t ../target/wasm32-wasi/release/deps/*.wasm | head -n 1` benchmarks.wasm | ||
``` | ||
|
||
### Running | ||
|
||
```bash | ||
wasmer-js run --dir=. benchmarks.wasm -- --bench | ||
``` | ||
|
||
### Results |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of this file as part of the codebase? Is it expected to change regularly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect it to change at least once after we finalize changes to the DKG scheme (simple vs fast decryption). We also introduced other changes that I want to keep track of.