-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba0a207
commit 22bc5ad
Showing
9 changed files
with
241 additions
and
193 deletions.
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
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,24 @@ | ||
#![feature(test)] | ||
|
||
extern crate test; | ||
extern crate bip39; | ||
|
||
use test::Bencher; | ||
|
||
use bip39::{Mnemonic, MnemonicType, Language}; | ||
|
||
#[bench] | ||
fn validate(b: &mut Bencher) { | ||
let phrase = "silly laptop awake length nature thunder category claim reveal supply attitude drip"; | ||
|
||
b.iter(|| { | ||
let _ = Mnemonic::validate(phrase, Language::English); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn new_mnemonic(b: &mut Bencher) { | ||
b.iter(|| { | ||
let _ = Mnemonic::new(MnemonicType::Type12Words, Language::English, ""); | ||
}) | ||
} |
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
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
Oops, something went wrong.