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

Cleanup bytecode constructor codegen #931

Merged
merged 9 commits into from
Feb 8, 2024
Merged

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Feb 8, 2024

This disentangles the macro heavy code and makes it a bit more readable. A superior version would be to use proc. macros and automatically generate constructors for the Instruction enum, however, that also introduces a lot of complexity.

@paritytech-cicd-pr
Copy link

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
br_table
1.59ms 1.63ms 🔴 2.60% 1.37ms 1.36ms ⚪ -0.60% 🟢 -16%
execute/
call/host/1
50.61µs 50.95µs ⚪ 0.68% 60.55µs 60.24µs ⚪ -0.51% 🟢 18%
execute/
call/rec
172.74µs 173.12µs ⚪ 0.22% 292.29µs 293.53µs ⚪ 0.42% 🟡 70%
execute/
count_until
5.54ms 5.56ms ⚪ 0.35% 7.24ms 7.23ms ⚪ -0.07% 🟢 30%
execute/
divrem
6.24ms 6.24ms ⚪ 0.13% 6.31ms 6.79ms 🔴 7.63% 🟢 9%
execute/
factorial/iter
258.53µs 262.59µs 🔴 1.57% 280.61µs 268.12µs 🟢 -4.45% 🟢 2%
execute/
factorial/rec
668.68µs 668.66µs ⚪ 0.00% 1.09ms 1.08ms ⚪ -0.64% 🟡 62%
execute/
fibonacci/iter
1.33ms 1.33ms ⚪ 0.11% 1.13ms 1.13ms ⚪ 0.04% 🟢 -15%
execute/
fibonacci/rec
5.79ms 5.82ms ⚪ 0.64% 10.69ms 10.90ms 🔴 2.02% 🟡 87%
execute/
fibonacci/tail
1.29ms 1.33ms 🔴 2.90% 3.47ms 3.95ms 🔴 13.72% 🔴 198%
execute/
fuse
7.07ms 7.07ms ⚪ 0.07% 11.16ms 11.15ms ⚪ -0.02% 🟡 58%
execute/
global/bump
1.32ms 1.32ms ⚪ 0.05% 1.45ms 1.62ms 🔴 11.53% 🟢 23%
execute/
global/get_const
498.85µs 480.11µs ⚪ -3.76% 726.49µs 726.50µs ⚪ 0.00% 🟡 51%
execute/
is_even/rec
1.09ms 1.09ms ⚪ 0.23% 1.81ms 1.81ms ⚪ 0.12% 🟡 66%
execute/
memory/fill_bytes
1.11ms 1.07ms ⚪ -3.93% 1.21ms 1.21ms ⚪ 0.03% 🟢 13%
execute/
memory/sum_bytes
1.04ms 1.03ms ⚪ -1.13% 1.43ms 1.38ms 🟢 -3.41% 🟢 34%
execute/
memory/vec_add
2.97ms 2.96ms ⚪ -0.13% 3.22ms 3.22ms ⚪ -0.06% 🟢 9%
execute/
recursive_scan
189.52µs 189.32µs ⚪ -0.10% 308.69µs 311.37µs ⚪ 0.87% 🟡 64%
execute/
recursive_trap
16.04µs 16.53µs 🔴 3.08% 27.60µs 28.10µs 🔴 1.80% 🟡 70%
execute/
regex_redux
581.82µs 586.18µs ⚪ 0.75% 973.81µs 972.83µs ⚪ -0.10% 🟡 66%
execute/
rev_complement
440.62µs 439.22µs ⚪ -0.32% 604.41µs 591.13µs 🟢 -2.20% 🟢 35%
execute/
tiny_keccak
350.69µs 350.29µs ⚪ -0.11% 316.86µs 316.91µs ⚪ 0.01% 🟢 -10%
execute/
trunc_f2i
631.63µs 634.62µs ⚪ 0.47% 930.17µs 931.41µs ⚪ 0.13% 🟢 47%
instantiate/
wasm_kernel
56.63µs 52.35µs 🟢 -7.55% 57.87µs 53.21µs 🟢 -8.06% 🟢 2%
overhead/
call/typed/0
1.23ms 1.23ms ⚪ 0.26% 853.78µs 865.50µs 🔴 1.37% 🟢 -30%
overhead/
call/typed/16
1.67ms 1.66ms ⚪ -0.26% 2.17ms 2.17ms ⚪ 0.38% 🟢 31%
overhead/
call/untyped/0
1.59ms 1.58ms ⚪ -1.02% 1.11ms 1.11ms ⚪ -0.53% 🟢 -30%
overhead/
call/untyped/16
2.42ms 2.44ms ⚪ 0.46% 3.96ms 3.99ms ⚪ 0.72% 🟡 64%
translate/
bz2/checked/eager/default
1.34ms 1.35ms ⚪ 0.48% 2.45ms 2.48ms ⚪ 1.22% 🟡 84%
translate/
bz2/checked/eager/fuel
1.45ms 1.45ms ⚪ 0.04% 2.65ms 2.69ms 🔴 1.42% 🟡 85%
translate/
bz2/checked/lazy-translation/default
547.06µs 545.82µs ⚪ -0.23% 950.94µs 952.42µs ⚪ 0.16% 🟡 74%
translate/
bz2/checked/lazy/default
36.25µs 37.15µs 🔴 2.51% 44.97µs 44.68µs ⚪ -0.65% 🟢 20%
translate/
bz2/unchecked/eager/default
1.10ms 1.12ms ⚪ 1.52% 1.91ms 1.91ms ⚪ 0.00% 🟡 70%
translate/
erc1155/checked/eager/default
282.80µs 281.37µs ⚪ -0.50% 478.02µs 482.84µs ⚪ 1.01% 🟡 72%
translate/
erc1155/checked/eager/fuel
300.20µs 302.55µs ⚪ 0.78% 512.75µs 519.29µs 🔴 1.27% 🟡 72%
translate/
erc1155/checked/lazy-translation/default
127.60µs 127.46µs ⚪ -0.11% 209.01µs 209.09µs ⚪ 0.04% 🟡 64%
translate/
erc1155/checked/lazy/default
25.80µs 25.92µs ⚪ 0.45% 32.43µs 32.06µs ⚪ -1.14% 🟢 24%
translate/
erc1155/unchecked/eager/default
232.00µs 235.09µs 🔴 1.33% 375.52µs 375.20µs ⚪ -0.08% 🟡 60%
translate/
erc20/checked/eager/default
137.78µs 137.09µs ⚪ -0.50% 227.95µs 232.81µs 🔴 2.13% 🟡 70%
translate/
erc20/checked/eager/fuel
145.52µs 145.28µs ⚪ -0.17% 242.11µs 244.92µs ⚪ 1.16% 🟡 69%
translate/
erc20/checked/lazy-translation/default
64.53µs 65.47µs 🔴 1.46% 105.90µs 106.27µs ⚪ 0.36% 🟡 62%
translate/
erc20/checked/lazy/default
18.82µs 18.97µs ⚪ 0.80% 24.49µs 24.37µs ⚪ -0.49% 🟢 28%
translate/
erc20/unchecked/eager/default
112.03µs 113.87µs 🔴 1.65% 178.23µs 179.42µs ⚪ 0.67% 🟡 58%
translate/
erc721/checked/eager/default
194.16µs 194.57µs ⚪ 0.21% 331.06µs 336.93µs 🔴 1.77% 🟡 73%
translate/
erc721/checked/eager/fuel
203.10µs 204.33µs ⚪ 0.61% 348.83µs 355.33µs 🔴 1.86% 🟡 74%
translate/
erc721/checked/lazy-translation/default
90.71µs 90.77µs ⚪ 0.06% 151.20µs 151.10µs ⚪ -0.07% 🟡 66%
translate/
erc721/checked/lazy/default
22.56µs 23.13µs 🔴 2.55% 28.56µs 28.76µs ⚪ 0.71% 🟢 24%
translate/
erc721/unchecked/eager/default
157.66µs 159.99µs 🔴 1.48% 254.31µs 254.78µs ⚪ 0.19% 🟡 59%
translate/
pulldown_cmark/checked/eager/default
3.61ms 3.64ms ⚪ 0.68% 6.22ms 6.28ms ⚪ 1.03% 🟡 73%
translate/
pulldown_cmark/checked/eager/fuel
3.90ms 3.91ms ⚪ 0.06% 6.70ms 6.79ms 🔴 1.23% 🟡 74%
translate/
pulldown_cmark/checked/lazy-translation/default
1.55ms 1.55ms ⚪ 0.16% 2.53ms 2.53ms ⚪ 0.07% 🟡 63%
translate/
pulldown_cmark/checked/lazy/default
245.57µs 256.38µs 🔴 4.40% 246.76µs 256.06µs 🔴 3.77% 🟢 -0%
translate/
pulldown_cmark/unchecked/eager/default
3.05ms 3.09ms 🔴 1.53% 4.91ms 4.93ms ⚪ 0.30% 🟡 59%
translate/
spidermonkey/checked/eager/default
77.16ms 77.33ms ⚪ 0.22% 134.82ms 136.31ms ⚪ 1.10% 🟡 76%
translate/
spidermonkey/checked/eager/fuel
83.21ms 83.53ms ⚪ 0.38% 145.66ms 147.83ms 🔴 1.49% 🟡 77%
translate/
spidermonkey/checked/lazy-translation/default
32.27ms 32.62ms ⚪ 1.09% 55.07ms 54.99ms ⚪ -0.14% 🟡 69%
translate/
spidermonkey/checked/lazy/default
3.21ms 3.25ms ⚪ 1.24% 3.77ms 3.78ms ⚪ 0.26% 🟢 16%
translate/
spidermonkey/unchecked/eager/default
64.39ms 65.01ms ⚪ 0.97% 106.39ms 106.95ms ⚪ 0.52% 🟡 65%
translate/
wasm_kernel/checked/eager/default
5.09ms 5.08ms ⚪ -0.30% 8.78ms 8.88ms 🔴 1.17% 🟡 75%
translate/
wasm_kernel/checked/eager/fuel
5.24ms 5.22ms ⚪ -0.47% 9.26ms 9.37ms 🔴 1.14% 🟡 80%
translate/
wasm_kernel/checked/lazy-translation/default
2.42ms 2.43ms ⚪ 0.45% 3.94ms 3.94ms ⚪ 0.16% 🟡 62%
translate/
wasm_kernel/checked/lazy/default
422.18µs 424.65µs ⚪ 0.59% 475.35µs 475.16µs ⚪ -0.04% 🟢 12%
translate/
wasm_kernel/unchecked/eager/default
4.14ms 4.19ms ⚪ 1.11% 6.76ms 7.01ms 🔴 3.59% 🟡 67%

Link to pipeline

@Robbepop Robbepop merged commit 352f8ae into master Feb 8, 2024
21 checks passed
@Robbepop Robbepop deleted the rf-cleanup-constructors branch February 8, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants