Full block import benchmark (#4865)

* full block import benchmark

* try rocksdb cache

* add profiling helper

* use random keyring instead of zero caching

* update docs

* add more io stats

* remove last sentence

* add ci job to see

* Update primitives/keyring/src/sr25519.rs

Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>

* switch to 100tx-block

* remove ci script

Co-authored-by: Marcio Diaz <marcio@parity.io>
This commit is contained in:
Nikolay Volf
2020-02-13 14:09:00 +03:00
committed by GitHub
parent 96862f835b
commit e6454eb091
10 changed files with 593 additions and 13 deletions
+3
View File
@@ -35,6 +35,9 @@ pub type Client = sc_client::Client<
node_runtime::RuntimeApi,
>;
/// Transaction for node-runtime.
pub type Transaction = sc_client_api::backend::TransactionFor<Backend, node_primitives::Block>;
/// Genesis configuration parameters for `TestClient`.
#[derive(Default)]
pub struct GenesisParameters {
+26 -9
View File
@@ -21,14 +21,38 @@ use sp_keyring::{Ed25519Keyring, Sr25519Keyring};
use node_runtime::{
GenesisConfig, BalancesConfig, SessionConfig, StakingConfig, SystemConfig,
GrandpaConfig, IndicesConfig, ContractsConfig, SocietyConfig, WASM_BINARY,
AccountId,
};
use node_runtime::constants::currency::*;
use sp_core::ChangesTrieConfiguration;
use sp_runtime::Perbill;
/// Create genesis runtime configuration for tests.
pub fn config(support_changes_trie: bool, code: Option<&[u8]>) -> GenesisConfig {
config_endowed(support_changes_trie, code, Default::default())
}
/// Create genesis runtime configuration for tests with some extra
/// endowed accounts.
pub fn config_endowed(
support_changes_trie: bool,
code: Option<&[u8]>,
extra_endowed: Vec<AccountId>,
) -> GenesisConfig {
let mut endowed = vec![
(alice(), 111 * DOLLARS),
(bob(), 100 * DOLLARS),
(charlie(), 100_000_000 * DOLLARS),
(dave(), 111 * DOLLARS),
(eve(), 101 * DOLLARS),
(ferdie(), 100 * DOLLARS),
];
endowed.extend(
extra_endowed.into_iter().map(|endowed| (endowed, 100*DOLLARS))
);
GenesisConfig {
frame_system: Some(SystemConfig {
changes_trie_config: if support_changes_trie { Some(ChangesTrieConfiguration {
@@ -41,14 +65,7 @@ pub fn config(support_changes_trie: bool, code: Option<&[u8]>) -> GenesisConfig
ids: vec![alice(), bob(), charlie(), dave(), eve(), ferdie()],
}),
pallet_balances: Some(BalancesConfig {
balances: vec![
(alice(), 111 * DOLLARS),
(bob(), 100 * DOLLARS),
(charlie(), 100_000_000 * DOLLARS),
(dave(), 111 * DOLLARS),
(eve(), 101 * DOLLARS),
(ferdie(), 100 * DOLLARS),
],
balances: endowed,
}),
pallet_session: Some(SessionConfig {
keys: vec![