Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(gear,vara): Update weights #2928

Merged
merged 9 commits into from
Jul 14, 2023
Merged

chore(gear,vara): Update weights #2928

merged 9 commits into from
Jul 14, 2023

Conversation

gshep
Copy link
Member

@gshep gshep commented Jul 12, 2023

@gshep gshep requested review from breathx and ukint-vs July 12, 2023 10:53
@gshep
Copy link
Member Author

gshep commented Jul 12, 2023

Comparison table for Gear runtime

| name                    | master  | gshep/update-weights-79 | diff    |
|-------------------------|---------|-------------------------|---------|
| i64const                | 173 ps  | 115 ps                  | +50.43% |
| i64load                 | 6.7 ns  | 6.6 ns                  | +1.60%  |
| i32load                 | 6.8 ns  | 6.6 ns                  | +2.78%  |
| i64store                | 31.2 ns | 36.4 ns                 | -14.05% |
| i32store                | 25.7 ns | 25.1 ns                 | +2.29%  |
| select                  | 7.3 ns  | 7.0 ns                  | +4.32%  |
| if                      | 6.1 ns  | 5.9 ns                  | +3.09%  |
| br                      | 3.1 ns  | 3.2 ns                  | -3.32%  |
| br_if                   | 5.6 ns  | 5.5 ns                  | +0.69%  |
| br_table                | 10.5 ns | 9.2 ns                  | +14.96% |
| br_table_per_entry      | 168 ps  | 322 ps                  | -47.83% |
| call                    | 4.5 ns  | 4.7 ns                  | -5.15%  |
| call_indirect           | 21.1 ns | 17.3 ns                 | +21.46% |
| call_indirect_per_param | 1.8 ns  | 1.9 ns                  | -6.61%  |
| call_per_local          | 0 ps    | 0 ps                    | N/A     |
| local_get               | 451 ps  | 519 ps                  | -13.10% |
| local_set               | 1.1 ns  | 1.5 ns                  | -28.30% |
| local_tee               | 1.2 ns  | 1.3 ns                  | -9.78%  |
| global_get              | 1.2 ns  | 1.5 ns                  | -19.55% |
| global_set              | 1.9 ns  | 2.8 ns                  | -31.62% |
| memory_current          | 13.8 ns | 14.1 ns                 | -1.91%  |
| i64clz                  | 6.7 ns  | 6.6 ns                  | +1.09%  |
| i32clz                  | 6.2 ns  | 6.0 ns                  | +3.05%  |
| i64ctz                  | 5.8 ns  | 5.8 ns                  | -0.43%  |
| i32ctz                  | 4.8 ns  | 5.2 ns                  | -6.88%  |
| i64popcnt               | 894 ps  | 1.3 ns                  | -31.70% |
| i32popcnt               | 568 ps  | 683 ps                  | -16.84% |
| i64eqz                  | 3.0 ns  | 3.4 ns                  | -13.93% |
| i32eqz                  | 1.6 ns  | 2.2 ns                  | -25.62% |
| i32extend8s             | 852 ps  | 771 ps                  | +10.51% |
| i32extend16s            | 767 ps  | 778 ps                  | -1.41%  |
| i64extend8s             | 885 ps  | 1.1 ns                  | -19.33% |
| i64extend16s            | 877 ps  | 1.1 ns                  | -17.96% |
| i64extend32s            | 888 ps  | 941 ps                  | -5.63%  |
| i64extendsi32           | 534 ps  | 781 ps                  | -31.63% |
| i64extendui32           | 319 ps  | 332 ps                  | -3.92%  |
| i32wrapi64              | 147 ps  | 268 ps                  | -45.15% |
| i64eq                   | 3.2 ns  | 3.3 ns                  | -2.81%  |
| i32eq                   | 1.7 ns  | 2.0 ns                  | -14.53% |
| i64ne                   | 3.1 ns  | 3.5 ns                  | -11.76% |
| i32ne                   | 1.8 ns  | 2.1 ns                  | -16.97% |
| i64lts                  | 3.2 ns  | 3.3 ns                  | -1.82%  |
| i32lts                  | 1.8 ns  | 2.1 ns                  | -13.33% |
| i64ltu                  | 3.1 ns  | 3.6 ns                  | -13.35% |
| i32ltu                  | 1.9 ns  | 2.1 ns                  | -9.02%  |
| i64gts                  | 3.3 ns  | 3.3 ns                  | -1.46%  |
| i32gts                  | 2.1 ns  | 2.2 ns                  | -8.26%  |
| i64gtu                  | 3.4 ns  | 3.4 ns                  | -0.85%  |
| i32gtu                  | 1.7 ns  | 2.1 ns                  | -20.06% |
| i64les                  | 3.1 ns  | 3.4 ns                  | -8.65%  |
| i32les                  | 1.7 ns  | 2.2 ns                  | -20.49% |
| i64leu                  | 2.9 ns  | 3.5 ns                  | -16.50% |
| i32leu                  | 1.7 ns  | 2.1 ns                  | -21.24% |
| i64ges                  | 3.0 ns  | 3.5 ns                  | -14.46% |
| i32ges                  | 1.6 ns  | 2.0 ns                  | -20.24% |
| i64geu                  | 2.8 ns  | 3.3 ns                  | -14.44% |
| i32geu                  | 1.6 ns  | 2.2 ns                  | -27.81% |
| i64add                  | 2.0 ns  | 2.2 ns                  | -12.71% |
| i32add                  | 792 ps  | 1.1 ns                  | -26.60% |
| i64sub                  | 1.9 ns  | 2.3 ns                  | -14.68% |
| i32sub                  | 747 ps  | 1.3 ns                  | -40.38% |
| i64mul                  | 2.8 ns  | 3.3 ns                  | -14.42% |
| i32mul                  | 1.7 ns  | 2.2 ns                  | -21.76% |
| i64divs                 | 4.8 ns  | 3.4 ns                  | +43.55% |
| i32divs                 | 3.9 ns  | 3.2 ns                  | +20.85% |
| i64divu                 | 5.1 ns  | 3.6 ns                  | +40.39% |
| i32divu                 | 3.9 ns  | 3.4 ns                  | +15.93% |
| i64rems                 | 18.8 ns | 14.8 ns                 | +26.64% |
| i32rems                 | 14.7 ns | 12.5 ns                 | +17.47% |
| i64remu                 | 5.3 ns  | 4.0 ns                  | +32.93% |
| i32remu                 | 4.2 ns  | 3.6 ns                  | +16.39% |
| i64and                  | 2.0 ns  | 2.3 ns                  | -12.00% |
| i32and                  | 751 ps  | 1.2 ns                  | -38.44% |
| i64or                   | 2.1 ns  | 2.4 ns                  | -12.30% |
| i32or                   | 724 ps  | 1.0 ns                  | -29.50% |
| i64xor                  | 2.0 ns  | 2.3 ns                  | -15.57% |
| i32xor                  | 828 ps  | 1.2 ns                  | -30.71% |
| i64shl                  | 1.7 ns  | 1.9 ns                  | -11.09% |
| i32shl                  | 677 ps  | 1.0 ns                  | -33.56% |
| i64shrs                 | 1.5 ns  | 1.9 ns                  | -18.56% |
| i32shrs                 | 710 ps  | 1.0 ns                  | -29.35% |
| i64shru                 | 1.8 ns  | 1.8 ns                  | +2.58%  |
| i32shru                 | 732 ps  | 1.1 ns                  | -34.11% |
| i64rotl                 | 1.7 ns  | 1.9 ns                  | -10.29% |
| i32rotl                 | 800 ps  | 1.1 ns                  | -27.86% |
| i64rotr                 | 1.6 ns  | 1.9 ns                  | -14.99% |
| i32rotr                 | 672 ps  | 1.0 ns                  | -33.92% |


Comparison table for Gear runtime

| name                                    | master   | gshep/update-weights-79 | diff     |
|-----------------------------------------|----------|-------------------------|----------|
| alloc                                   | 2.0 µs   | 5.5 µs                  | -62.72%  |
| free                                    | 2.0 µs   | 5.4 µs                  | -62.23%  |
| gr_reserve_gas                          | 4.3 µs   | 5.3 µs                  | -18.17%  |
| gr_unreserve_gas                        | 4.7 µs   | 5.4 µs                  | -13.20%  |
| gr_system_reserve_gas                   | 2.9 µs   | 3.8 µs                  | -25.14%  |
| gr_gas_available                        | 2.8 µs   | 3.7 µs                  | -23.88%  |
| gr_message_id                           | 2.8 µs   | 3.7 µs                  | -24.02%  |
| gr_pay_program_rent                     | 115.0 ns | 68.5 ns                 | +67.91%  |
| gr_program_id                           | 2.8 µs   | 3.7 µs                  | -23.41%  |
| gr_source                               | 2.8 µs   | 3.6 µs                  | -23.17%  |
| gr_value                                | 2.8 µs   | 3.7 µs                  | -23.77%  |
| gr_value_available                      | 2.8 µs   | 3.7 µs                  | -24.84%  |
| gr_size                                 | 2.8 µs   | 3.7 µs                  | -24.86%  |
| gr_read                                 | 3.8 µs   | 4.9 µs                  | -21.80%  |
| gr_read_per_byte                        | 165 ps   | 164 ps                  | +0.61%   |
| gr_block_height                         | 2.8 µs   | 3.6 µs                  | -23.43%  |
| gr_block_timestamp                      | 2.8 µs   | 3.7 µs                  | -22.31%  |
| gr_random                               | 3.7 µs   | 4.6 µs                  | -20.40%  |
| gr_reply_deposit                        | 3.9 µs   | 11.2 µs                 | -65.19%  |
| gr_send                                 | 5.4 µs   | 5.6 µs                  | -4.41%   |
| gr_send_per_byte                        | 260 ps   | 303 ps                  | -14.19%  |
| gr_send_wgas                            | 5.4 µs   | 7.1 µs                  | -23.65%  |
| gr_send_wgas_per_byte                   | 258 ps   | 303 ps                  | -14.85%  |
| gr_send_init                            | 2.9 µs   | 3.7 µs                  | -22.21%  |
| gr_send_push                            | 4.1 µs   | 6.4 µs                  | -35.96%  |
| gr_send_push_per_byte                   | 386 ps   | 424 ps                  | -8.96%   |
| gr_send_commit                          | 4.9 µs   | 6.9 µs                  | -30.17%  |
| gr_send_commit_wgas                     | 5.0 µs   | 7.3 µs                  | -31.21%  |
| gr_reservation_send                     | 5.5 µs   | 7.0 µs                  | -21.30%  |
| gr_reservation_send_per_byte            | 263 ps   | 304 ps                  | -13.49%  |
| gr_reservation_send_commit              | 5.0 µs   | 7.4 µs                  | -32.78%  |
| gr_reply_commit                         | 24.1 µs  | 28.4 µs                 | -15.04%  |
| gr_reply_commit_wgas                    | 21.8 µs  | 30.7 µs                 | -28.87%  |
| gr_reservation_reply                    | 15.1 µs  | 12.4 µs                 | +21.97%  |
| gr_reservation_reply_per_byte           | 431.8 ns | 490.8 ns                | -12.03%  |
| gr_reservation_reply_commit             | 18.2 µs  | 2.1 µs                  | +748.15% |
| gr_reply_push                           | 4.0 µs   | 4.9 µs                  | -19.87%  |
| gr_reply                                | 27.8 µs  | 28.4 µs                 | -2.04%   |
| gr_reply_per_byte                       | 419 ps   | 471 ps                  | -11.04%  |
| gr_reply_wgas                           | 25.8 µs  | 43.8 µs                 | -41.03%  |
| gr_reply_wgas_per_byte                  | 417 ps   | 476 ps                  | -12.39%  |
| gr_reply_push_per_byte                  | 625 ps   | 732 ps                  | -14.62%  |
| gr_reply_to                             | 2.8 µs   | 3.7 µs                  | -22.96%  |
| gr_signal_from                          | 2.8 µs   | 3.7 µs                  | -23.54%  |
| gr_reply_input                          | 29.4 µs  | 12.1 µs                 | +142.51% |
| gr_reply_input_wgas                     | 30.4 µs  | 35.2 µs                 | -13.59%  |
| gr_reply_push_input                     | 3.0 µs   | 3.9 µs                  | -23.48%  |
| gr_reply_push_input_per_byte            | 150 ps   | 123 ps                  | +21.95%  |
| gr_send_input                           | 5.5 µs   | 7.0 µs                  | -20.60%  |
| gr_send_input_wgas                      | 5.6 µs   | 7.1 µs                  | -21.39%  |
| gr_send_push_input                      | 3.2 µs   | 5.5 µs                  | -41.18%  |
| gr_send_push_input_per_byte             | 167 ps   | 149 ps                  | +12.08%  |
| gr_debug                                | 3.0 µs   | 4.0 µs                  | -26.21%  |
| gr_debug_per_byte                       | 315 ps   | 372 ps                  | -15.32%  |
| gr_reply_code                           | 2.8 µs   | 3.7 µs                  | -23.91%  |
| gr_exit                                 | 26.1 µs  | 34.1 µs                 | -23.57%  |
| gr_leave                                | 13.9 µs  | 32.1 µs                 | -56.68%  |
| gr_wait                                 | 15.1 µs  | 16.5 µs                 | -8.64%   |
| gr_wait_for                             | 14.7 µs  | 17.3 µs                 | -15.51%  |
| gr_wait_up_to                           | 14.0 µs  | 31.0 µs                 | -54.83%  |
| gr_wake                                 | 4.2 µs   | 5.1 µs                  | -18.77%  |
| gr_create_program                       | 6.4 µs   | 8.1 µs                  | -20.62%  |
| gr_create_program_payload_per_byte      | 90 ps    | 111 ps                  | -18.92%  |
| gr_create_program_salt_per_byte         | 1.9 ns   | 2.2 ns                  | -13.38%  |
| gr_create_program_wgas                  | 6.5 µs   | 8.3 µs                  | -22.00%  |
| gr_create_program_wgas_payload_per_byte | 84 ps    | 111 ps                  | -24.32%  |
| gr_create_program_wgas_salt_per_byte    | 1.9 ns   | 2.2 ns                  | -13.71%  |

@gshep gshep self-assigned this Jul 12, 2023
@gshep gshep added A0-pleasereview PR is ready to be reviewed by the team D2-node Gear Node labels Jul 12, 2023
@ukint-vs ukint-vs changed the title chore(node): Update weights chore(gear,vara): Update weights Jul 12, 2023
@breathx
Copy link
Member

breathx commented Jul 12, 2023

Need to adjust tests that are sensitive for weights and :/

Conflicts:
	pallets/gear/src/weights.rs
	runtime/gear/src/weights/pallet_gear.rs
	runtime/vara/src/weights/pallet_gear.rs
pallets/gear/src/mock.rs Outdated Show resolved Hide resolved
pallets/gear/src/mock.rs Show resolved Hide resolved
pallets/gear/src/tests.rs Outdated Show resolved Hide resolved
pallets/gear/src/tests.rs Outdated Show resolved Hide resolved
runtime/gear/src/weights/pallet_gear.rs Show resolved Hide resolved
@breathx
Copy link
Member

breathx commented Jul 14, 2023

@gshep feel free to merge than

Conflicts:
	pallets/gear/src/tests.rs
@gshep gshep merged commit 0813181 into master Jul 14, 2023
10 checks passed
@gshep gshep deleted the gshep/update-weights-79 branch July 14, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview PR is ready to be reviewed by the team D2-node Gear Node
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants