|
14 | 14 | // You should have received a copy of the GNU General Public License
|
15 | 15 | // along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
16 | 16 |
|
17 |
| -//! Autogenerated weights for `{{pallet}}` |
| 17 | +//! Autogenerated weights for {{pallet}} |
18 | 18 | //!
|
19 | 19 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
|
20 |
| -//! DATE: {{date}}, STEPS: {{cmd.steps}}, REPEAT: {{cmd.repeat}} |
21 |
| -//! LOW RANGE: {{cmd.lowest_range_values}}, HIGH RANGE: {{cmd.highest_range_values}} |
22 |
| -//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}} |
23 |
| -//! CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} |
| 20 | +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` |
| 21 | +//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}` |
| 22 | +//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` |
| 23 | +//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} |
24 | 24 |
|
25 | 25 | // Executed Command:
|
26 |
| -{{#each args as |arg|~}} |
| 26 | +{{#each args as |arg|}} |
27 | 27 | // {{arg}}
|
28 | 28 | {{/each}}
|
29 | 29 |
|
|
35 | 35 | use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
36 | 36 | use sp_std::marker::PhantomData;
|
37 | 37 |
|
38 |
| -/// Weight functions needed for `{{pallet}}`. |
| 38 | +/// Weight functions needed for {{pallet}}. |
39 | 39 | pub trait WeightInfo {
|
40 |
| - {{~#each benchmarks as |benchmark|}} |
| 40 | + {{#each benchmarks as |benchmark|}} |
41 | 41 | fn {{benchmark.name~}}
|
42 | 42 | (
|
43 | 43 | {{~#each benchmark.components as |c| ~}}
|
44 | 44 | {{c.name}}: u32, {{/each~}}
|
45 | 45 | ) -> Weight;
|
46 |
| - {{~/each}} |
| 46 | + {{/each}} |
47 | 47 | }
|
48 | 48 |
|
49 | 49 | /// Weights for `{{pallet}}` that are generated using one of the Bridge testnets.
|
50 | 50 | ///
|
51 |
| -/// Those weights are test only and must never be used in production. |
| 51 | +/// Those weights are test only and must never be used in production. |
52 | 52 | pub struct BridgeWeight<T>(PhantomData<T>);
|
53 | 53 | impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
54 |
| - {{~#each benchmarks as |benchmark|}} |
| 54 | + {{#each benchmarks as |benchmark|}} |
| 55 | + {{#each benchmark.comments as |comment|}} |
| 56 | + /// {{comment}} |
| 57 | + /// |
| 58 | + {{/each}} |
| 59 | + {{#each benchmark.component_ranges as |range|}} |
| 60 | + /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. |
| 61 | + /// |
| 62 | + {{/each}} |
55 | 63 | fn {{benchmark.name~}}
|
56 | 64 | (
|
57 | 65 | {{~#each benchmark.components as |c| ~}}
|
58 | 66 | {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
|
59 | 67 | ) -> Weight {
|
60 |
| - Weight::from_ref_time({{underscore benchmark.base_weight}} as u64) |
61 |
| - {{~#each benchmark.component_weight as |cw|}} |
62 |
| - .saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64)) |
63 |
| - {{~/each}} |
64 |
| - {{~#if (ne benchmark.base_reads "0")}} |
65 |
| - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64)) |
66 |
| - {{~/if}} |
67 |
| - {{~#each benchmark.component_reads as |cr|}} |
68 |
| - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) |
69 |
| - {{~/each}} |
70 |
| - {{~#if (ne benchmark.base_writes "0")}} |
71 |
| - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64)) |
72 |
| - {{~/if}} |
73 |
| - {{~#each benchmark.component_writes as |cw|}} |
74 |
| - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) |
75 |
| - {{~/each}} |
| 68 | + // Proof Size summary in bytes: |
| 69 | + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` |
| 70 | + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` |
| 71 | + // Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds. |
| 72 | + {{#if (ne benchmark.base_calculated_proof_size "0")}} |
| 73 | + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) |
| 74 | + {{else}} |
| 75 | + Weight::from_ref_time({{underscore benchmark.base_weight}}) |
| 76 | + {{/if}} |
| 77 | + {{#each benchmark.component_weight as |cw|}} |
| 78 | + // Standard Error: {{underscore cw.error}} |
| 79 | + .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) |
| 80 | + {{/each}} |
| 81 | + {{#if (ne benchmark.base_reads "0")}} |
| 82 | + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64)) |
| 83 | + {{/if}} |
| 84 | + {{#each benchmark.component_reads as |cr|}} |
| 85 | + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) |
| 86 | + {{/each}} |
| 87 | + {{#if (ne benchmark.base_writes "0")}} |
| 88 | + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64)) |
| 89 | + {{/if}} |
| 90 | + {{#each benchmark.component_writes as |cw|}} |
| 91 | + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) |
| 92 | + {{/each}} |
| 93 | + {{#each benchmark.component_calculated_proof_size as |cp|}} |
| 94 | + .saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into())) |
| 95 | + {{/each}} |
76 | 96 | }
|
77 |
| - {{~/each}} |
| 97 | + {{/each}} |
78 | 98 | }
|
79 | 99 |
|
80 | 100 | // For backwards compatibility and tests
|
81 | 101 | impl WeightInfo for () {
|
82 |
| - {{~#each benchmarks as |benchmark|}} |
| 102 | + {{#each benchmarks as |benchmark|}} |
| 103 | + {{#each benchmark.comments as |comment|}} |
| 104 | + /// {{comment}} |
| 105 | + /// |
| 106 | + {{/each}} |
| 107 | + {{#each benchmark.component_ranges as |range|}} |
| 108 | + /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. |
| 109 | + /// |
| 110 | + {{/each}} |
83 | 111 | fn {{benchmark.name~}}
|
84 | 112 | (
|
85 | 113 | {{~#each benchmark.components as |c| ~}}
|
86 | 114 | {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
|
87 | 115 | ) -> Weight {
|
88 |
| - Weight::from_ref_time({{underscore benchmark.base_weight}} as u64) |
89 |
| - {{~#each benchmark.component_weight as |cw|}} |
90 |
| - .saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64)) |
91 |
| - {{~/each}} |
92 |
| - {{~#if (ne benchmark.base_reads "0")}} |
93 |
| - .saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as u64)) |
94 |
| - {{~/if}} |
95 |
| - {{~#each benchmark.component_reads as |cr|}} |
96 |
| - .saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) |
97 |
| - {{~/each}} |
98 |
| - {{~#if (ne benchmark.base_writes "0")}} |
99 |
| - .saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as u64)) |
100 |
| - {{~/if}} |
101 |
| - {{~#each benchmark.component_writes as |cw|}} |
102 |
| - .saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) |
103 |
| - {{~/each}} |
| 116 | + // Proof Size summary in bytes: |
| 117 | + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` |
| 118 | + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` |
| 119 | + // Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds. |
| 120 | + {{#if (ne benchmark.base_calculated_proof_size "0")}} |
| 121 | + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) |
| 122 | + {{else}} |
| 123 | + Weight::from_ref_time({{underscore benchmark.base_weight}}) |
| 124 | + {{/if}} |
| 125 | + {{#each benchmark.component_weight as |cw|}} |
| 126 | + // Standard Error: {{underscore cw.error}} |
| 127 | + .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) |
| 128 | + {{/each}} |
| 129 | + {{#if (ne benchmark.base_reads "0")}} |
| 130 | + .saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}_u64)) |
| 131 | + {{/if}} |
| 132 | + {{#each benchmark.component_reads as |cr|}} |
| 133 | + .saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) |
| 134 | + {{/each}} |
| 135 | + {{#if (ne benchmark.base_writes "0")}} |
| 136 | + .saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}_u64)) |
| 137 | + {{/if}} |
| 138 | + {{#each benchmark.component_writes as |cw|}} |
| 139 | + .saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) |
| 140 | + {{/each}} |
| 141 | + {{#each benchmark.component_calculated_proof_size as |cp|}} |
| 142 | + .saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into())) |
| 143 | + {{/each}} |
104 | 144 | }
|
105 |
| - {{~/each}} |
| 145 | + {{/each}} |
106 | 146 | }
|
0 commit comments