Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
dcca51e0
Unverified
Commit
dcca51e0
authored
2 years ago
by
bgallois
Browse files
Options
Downloads
Patches
Plain Diff
Add extrinsic_weights benchmark
parent
41f9ed72
No related branches found
No related tags found
1 merge request
!167
Storage benchmark
Pipeline
#31963
passed
2 years ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
runtime/common/src/constants.rs
+1
-1
1 addition, 1 deletion
runtime/common/src/constants.rs
runtime/common/src/weights.rs
+1
-0
1 addition, 0 deletions
runtime/common/src/weights.rs
runtime/common/src/weights/extrinsic_weights.rs
+63
-0
63 additions, 0 deletions
runtime/common/src/weights/extrinsic_weights.rs
with
65 additions
and
1 deletion
runtime/common/src/constants.rs
+
1
−
1
View file @
dcca51e0
...
...
@@ -69,7 +69,7 @@ pub fn block_weights(
expected_block_weight
:
Weight
,
normal_ratio
:
sp_arithmetic
::
Perbill
,
)
->
frame_system
::
limits
::
BlockWeights
{
let
base_weight
=
DbW
eight
::
get
()
.reads
(
1
)
+
Db
Weight
::
get
()
.writes
(
1
)
;
let
base_weight
=
crate
::
w
eight
s
::
extrinsic_weights
::
ExtrinsicBase
Weight
::
get
();
let
normal_weight
=
normal_ratio
*
expected_block_weight
;
frame_system
::
limits
::
BlockWeights
::
builder
()
.base_block
(
crate
::
weights
::
block_weights
::
BlockExecutionWeight
::
get
())
...
...
This diff is collapsed.
Click to expand it.
runtime/common/src/weights.rs
+
1
−
0
View file @
dcca51e0
...
...
@@ -20,6 +20,7 @@
#![allow(clippy::unnecessary_cast)]
pub
mod
block_weights
;
pub
mod
extrinsic_weights
;
pub
mod
frame_system
;
pub
mod
pallet_babe
;
pub
mod
pallet_balances
;
...
...
This diff is collapsed.
Click to expand it.
runtime/common/src/weights/extrinsic_weights.rs
0 → 100644
+
63
−
0
View file @
dcca51e0
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-19 (Y/M/D)
//! HOSTNAME: `benjamin-xps139380`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz`
//!
//! SHORT-NAME: `extrinsic`, LONG-NAME: `ExtrinsicBase`, RUNTIME: `Development`
//! WARMUPS: `10`, REPEAT: `100`
//! WEIGHT-PATH: `runtime/common/src/weights/`
//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0`
// Executed Command:
// target/release/duniter
// benchmark
// overhead
// --chain=gdev-benchmark
// --execution=wasm
// --wasm-execution=compiled
// --weight-path=runtime/common/src/weights/
// --warmup=10
use
sp_core
::
parameter_types
;
use
sp_weights
::{
constants
::
WEIGHT_PER_NANOS
,
Weight
};
parameter_types!
{
/// Time to execute a NO-OP extrinsic, for example `System::remark`.
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 203_855, 206_882
/// Average: 204_580
/// Median: 204_521
/// Std-Dev: 405.03
///
/// Percentiles nanoseconds:
/// 99th: 205_581
/// 95th: 205_130
/// 75th: 204_772
pub
const
ExtrinsicBaseWeight
:
Weight
=
WEIGHT_PER_NANOS
.saturating_mul
(
204_580
);
}
#[cfg(test)]
mod
test_weights
{
use
sp_weights
::
constants
;
/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn
sane
()
{
let
w
=
super
::
ExtrinsicBaseWeight
::
get
();
// At least 10 µs.
assert!
(
w
.ref_time
()
>=
10u64
*
constants
::
WEIGHT_PER_MICROS
.ref_time
(),
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!
(
w
.ref_time
()
<=
constants
::
WEIGHT_PER_MILLIS
.ref_time
(),
"Weight should be at most 1 ms."
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment