Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
7b33492
Starting
shawntabrizi Jan 16, 2020
3b12740
closer
shawntabrizi Jan 21, 2020
55cf8b6
Compiles!
shawntabrizi Jan 21, 2020
9da52bb
comments
shawntabrizi Jan 21, 2020
27127c0
Create seperate mock
shawntabrizi Jan 21, 2020
ae84e9f
Remove changes to test env
shawntabrizi Jan 21, 2020
06d1173
Fix step calculation
shawntabrizi Jan 21, 2020
9f25cf5
Add host function
shawntabrizi Jan 22, 2020
621cc0d
Merge remote-tracking branch 'upstream/master' into shawntabrizi-iden…
shawntabrizi Jan 22, 2020
ddff026
Add runtime api
shawntabrizi Jan 22, 2020
b32c805
Merge remote-tracking branch 'upstream/master' into shawntabrizi-iden…
shawntabrizi Jan 22, 2020
890ad0d
compiles
shawntabrizi Jan 22, 2020
0a1bcfc
Update to use offchain timestamp
shawntabrizi Jan 23, 2020
931702b
Gives a result
shawntabrizi Jan 27, 2020
e8c4992
added some CLI wip
shawntabrizi Jan 28, 2020
334d1e6
Merge branch 'master' of github.com:paritytech/substrate into shawnta…
arkpar Jan 28, 2020
e5657e9
make generic
shawntabrizi Jan 28, 2020
32e9e07
Update instance
shawntabrizi Jan 28, 2020
1e2630c
Remove CLI stuff
shawntabrizi Jan 28, 2020
bafbac0
Remove last cli stuff
shawntabrizi Jan 28, 2020
86b32ef
undo more changes
shawntabrizi Jan 28, 2020
dd87c93
Update benchmarks
shawntabrizi Jan 29, 2020
6814c1a
Merge remote-tracking branch 'upstream/master' into shawntabrizi-iden…
shawntabrizi Jan 29, 2020
7c089f7
Update Cargo.lock
shawntabrizi Jan 29, 2020
7bd0ae1
remove test
shawntabrizi Jan 29, 2020
862dc67
Move loop out of runtime
shawntabrizi Jan 30, 2020
6d0c8b4
Benchmarking externalities
arkpar Feb 3, 2020
1575aae
Merge branch 'shawntabrizi-identity-bench' of github.com:paritytech/s…
arkpar Feb 3, 2020
3c5dcf7
Benchmarking state
arkpar Feb 3, 2020
d7c0ae8
Implemented commit
arkpar Feb 3, 2020
38602b8
Make CLI work, move loop back into runtime
shawntabrizi Feb 4, 2020
9614ea7
Merge branch 'master' of github.com:paritytech/substrate into shawnta…
arkpar Feb 4, 2020
e6eeab8
Merge branch 'shawntabrizi-identity-bench' of github.com:paritytech/s…
arkpar Feb 4, 2020
5ee888f
Wipe resets to genesis
arkpar Feb 4, 2020
e0b48d2
Merge branch 'master' of github.com:paritytech/substrate into shawnta…
arkpar Feb 5, 2020
d73ca25
Speedup benchmarks
arkpar Feb 5, 2020
879826c
Use enum to select extrinsic within pallet
shawntabrizi Feb 5, 2020
e041347
CLI controls which module and extrinsic to call
shawntabrizi Feb 5, 2020
115290b
Select a pallet with cli
shawntabrizi Feb 5, 2020
283860c
Add steps and repeats to cli
shawntabrizi Feb 5, 2020
978a1b4
Merge branch 'shawntabrizi-identity-bench' of https://github.com/pari…
shawntabrizi Feb 6, 2020
ca890f6
Output as CSV format
shawntabrizi Feb 6, 2020
1cb8529
Introduce benchmark pallet
shawntabrizi Feb 6, 2020
1c97bd9
Append bench
shawntabrizi Feb 7, 2020
ea5c3e1
Use Results
shawntabrizi Feb 7, 2020
94bff4b
Merge remote-tracking branch 'upstream/master' into shawntabrizi-iden…
shawntabrizi Feb 7, 2020
55a2e85
fix merge
shawntabrizi Feb 7, 2020
6787808
Clear Identity benchmark
shawntabrizi Feb 7, 2020
4c2b218
Bench request judgment and cancel request
shawntabrizi Feb 8, 2020
833c377
Add final benchmarks
shawntabrizi Feb 8, 2020
3e27b42
Fix CSV output
shawntabrizi Feb 8, 2020
34838f6
Start cleaning up for PR
shawntabrizi Feb 8, 2020
93422d4
Bump numbers in `wasmtime` integration tests.
shawntabrizi Feb 8, 2020
6bcf639
Merge remote-tracking branch 'upstream/master' into shawntabrizi-iden…
shawntabrizi Feb 8, 2020
f73ca4a
More docs
shawntabrizi Feb 8, 2020
eecaac0
Add rockdb feature to bench
shawntabrizi Feb 8, 2020
6243911
Fix formatting issues
shawntabrizi Feb 8, 2020
09804e1
Add test feature to bench
shawntabrizi Feb 9, 2020
00809ad
Add test feature to bench
shawntabrizi Feb 9, 2020
8d509d0
Add rocksdb feature flag
shawntabrizi Feb 9, 2020
fe2d0a2
Update bench.rs
gavofyork Feb 9, 2020
91827e5
Merge branch 'master' into shawntabrizi-identity-bench
gavofyork Feb 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove changes to test env
  • Loading branch information
shawntabrizi committed Jan 21, 2020
commit ae84e9fb4b276e640ef4e8e88e648d05853cbb4b
11 changes: 5 additions & 6 deletions frame/identity/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,10 @@ impl Trait for Benchmark {
}
type System = frame_system::Module<Benchmark>;
type Balances = pallet_balances::Module<Benchmark>;
pub type Identity = Module<Benchmark>;
type Identity = Module<Benchmark>;

pub type BalancesCall = pallet_balances::Call<Benchmark>;
pub type IdentityCall = crate::Call<Benchmark>;


pub mod set_identity {
use super::*;

Expand All @@ -118,7 +116,7 @@ pub mod set_identity {
///
/// Sets up state randomly and returns a randomly generated `set_identity` with sensible (fixed)
/// values for all complexity components except those mentioned in the identity.
pub fn instance(components: &[(&'static str, u32)]) -> Call<Benchmark>
pub fn instance(components: &[(&'static str, u32)]) -> Call
{
// Add r registrars
let r = components.iter().find(|&c| c.0 == "R").unwrap();
Expand All @@ -131,9 +129,10 @@ pub mod set_identity {

// Create identity info with x additional fields
let x = components.iter().find(|&c| c.0 == "R").unwrap();
let data = Data::Raw(vec![0; x.1 as usize]);
// 32 byte data that we reuse below
let data = Data::Raw(vec![0; 32]);
let info = IdentityInfo {
additional: vec![(data.clone(), data.clone()); 3],
additional: vec![(data.clone(), data.clone()); x.1 as usize],
display: data.clone(),
legal: data.clone(),
web: data.clone(),
Expand Down
16 changes: 4 additions & 12 deletions frame/identity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -902,13 +902,13 @@ impl<T: Trait> Benchmarking for Module<T> {
}

#[cfg(test)]
pub mod tests {
mod tests {
use super::*;

use sp_runtime::traits::BadOrigin;
use frame_support::{
assert_ok, assert_noop, impl_outer_origin, parameter_types, weights::Weight,
ord_parameter_types, impl_outer_dispatch,
ord_parameter_types,
};
use sp_core::H256;
use frame_system::EnsureSignedBy;
Expand All @@ -922,14 +922,6 @@ pub mod tests {
pub enum Origin for Test where system = frame_system {}
}

impl_outer_dispatch! {
pub enum Call for Test where origin: Origin {
frame_system::System,
pallet_balances::Balances,
pallet_identity::Identity,
}
}

// For testing the module, we construct most of a mock runtime. This means
// first constructing a configuration type (`Test`) which `impl`s each of the
// configuration traits of modules we want to use.
Expand All @@ -946,7 +938,7 @@ pub mod tests {
type Index = u64;
type BlockNumber = u64;
type Hash = H256;
type Call = Call;
type Call = ();
type Hashing = BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
Expand Down Expand Up @@ -999,7 +991,7 @@ pub mod tests {
}
type System = frame_system::Module<Test>;
type Balances = pallet_balances::Module<Test>;
pub type Identity = Module<Test>;
type Identity = Module<Test>;

// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
Expand Down