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

Crypto verify benchmarks #801

Merged
merged 12 commits into from
Feb 26, 2021
Merged

Crypto verify benchmarks #801

merged 12 commits into from
Feb 26, 2021

Conversation

maurolacy
Copy link
Contributor

@maurolacy maurolacy commented Feb 25, 2021

Implements digital signature verification benchmarks. Related to #758.

Some results on my machine:

$ cargo bench
    Finished bench [optimized] target(s) in 0.21s
     Running .../cosmwasm/target/release/deps/main-eaae5b3aaca9452a
Crypto/secp256k1_verify time:   [175.56 us 175.67 us 175.82 us]                                   
                        change: [-0.1863% -0.0758% +0.0316%] (p = 0.20 > 0.05)
                        No change in performance detected.
Crypto/secp256k1_recover_pubkey                                                                           
                        time:   [176.09 us 176.24 us 176.39 us]
                        change: [-0.0200% +0.0859% +0.2043%] (p = 0.16 > 0.05)
                        No change in performance detected.
Found 1 outliers among 12 measurements (8.33%)
  1 (8.33%) high mild
Crypto/ed25519_verify   time:   [70.576 us 70.609 us 70.648 us]                                  
                        change: [+0.0043% +0.1324% +0.2619%] (p = 0.06 > 0.05)
                        No change in performance detected.
Crypto/ed25519_batch_verify_five                                                                           
                        time:   [247.89 us 248.13 us 248.33 us]
                        change: [+0.0201% +0.1410% +0.2761%] (p = 0.04 < 0.05)
                        Change within noise threshold.

$  

ed25519_batch_verify_five verifies a batch of five entries (~50 us per entry; not bad). I'll now add some more benches for this, i. e. ed25519_batch_verify_one, two, three, ...

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Could you add a block to the package readme how to execute (see vm's README)? Could you execute the benchmarks in the benchmarking CI job?

packages/crypto/src/secp256k1.rs Outdated Show resolved Hide resolved
packages/crypto/benches/main.rs Outdated Show resolved Hide resolved
@maurolacy maurolacy force-pushed the crypto-verify-benchmarks branch 3 times, most recently from e1bee0a to 237dbd1 Compare February 25, 2021 18:27
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Just the update to Rust 1.49.0, then merge

.circleci/config.yml Outdated Show resolved Hide resolved
@maurolacy maurolacy force-pushed the crypto-verify-benchmarks branch from dbdf34e to 8326174 Compare February 25, 2021 21:42
@webmaster128 webmaster128 merged commit a674bf7 into main Feb 26, 2021
@webmaster128 webmaster128 deleted the crypto-verify-benchmarks branch February 26, 2021 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants