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

Add F64Const32 instruction #746

Merged
merged 2 commits into from
Jul 31, 2023
Merged

Add F64Const32 instruction #746

merged 2 commits into from
Jul 31, 2023

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Jul 31, 2023

This is an optimization for certain constant f64 values that can losslessly be encoded as 32-bit f32 values. This way we can avoid allocating ConstRef for many common cases.

This is an optimization for certain constant f64 values that can losslessly be encoded as 32-bit f32 values. This way we can avoid allocating ConstRef for many common cases.
@paritytech-cicd-pr
Copy link

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.52ms 1.52ms ⚪ 0.31% 1.14ms 1.28ms 🔴 16.03% 🟢 -16%
execute/
bare_call_0/typed
1.13ms 1.12ms ⚪ -1.41% 712.17µs 790.42µs 🔴 8.94% 🟢 -29%
execute/
bare_call_1
1.59ms 1.59ms ⚪ 0.28% 1.34ms 1.45ms 🔴 8.84% 🟢 -9%
execute/
bare_call_16
2.57ms 2.51ms ⚪ -1.25% 3.70ms 3.70ms 🔴 0.85% 🟢 48%
execute/
bare_call_16/typed
1.54ms 1.58ms ⚪ 1.44% 1.92ms 2.09ms 🔴 10.48% 🟢 33%
execute/
bare_call_1/typed
1.24ms 1.24ms ⚪ -0.49% 1.06ms 1.12ms 🔴 4.86% 🟢 -9%
execute/
bare_call_4
1.76ms 1.76ms ⚪ -0.58% 1.84ms 2.02ms 🔴 8.79% 🟢 15%
execute/
bare_call_4/typed
1.23ms 1.23ms ⚪ 0.11% 1.02ms 1.11ms 🔴 8.02% 🟢 -10%
execute/
br_table
1.37ms 1.33ms 🟢 -2.51% 1.25ms 1.25ms ⚪ -0.99% 🟢 -6%
execute/
count_until
620.65µs 645.17µs 🔴 4.09% 1.42ms 1.45ms ⚪ 1.91% 🔴 124%
execute/
factorial_iterative
318.64µs 319.53µs ⚪ 0.21% 727.43µs 723.61µs ⚪ 1.57% 🔴 126%
execute/
factorial_recursive
509.68µs 514.67µs ⚪ 0.98% 1.06ms 934.86µs 🟢 -11.10% 🟡 82%
execute/
fibonacci_iter
1.40ms 1.40ms ⚪ -0.07% 3.41ms 3.50ms ⚪ 2.48% 🔴 151%
execute/
fibonacci_rec
4.21ms 4.22ms ⚪ 0.16% 8.20ms 8.39ms ⚪ -1.04% 🟡 99%
execute/
fibonacci_tail
972.38µs 1.08ms 🔴 11.28% 1.96ms 1.95ms ⚪ -0.62% 🟡 81%
execute/
global_bump
741.87µs 745.77µs ⚪ 0.62% 1.91ms 1.83ms 🟢 -5.00% 🔴 145%
execute/
global_const
660.69µs 712.87µs 🔴 7.82% 1.88ms 1.93ms 🔴 3.36% 🔴 171%
execute/
host_calls
36.45µs 37.54µs ⚪ 2.03% 42.27µs 48.43µs 🔴 13.74% 🟢 29%
execute/
memory_fill
1.15ms 1.16ms ⚪ 0.22% 2.89ms 2.84ms 🟢 -2.18% 🔴 145%
execute/
memory_sum
1.13ms 1.13ms ⚪ 0.00% 2.69ms 2.80ms 🔴 3.57% 🔴 147%
execute/
memory_vec_add
2.37ms 2.30ms ⚪ -2.85% 5.86ms 6.14ms 🔴 5.55% 🔴 167%
execute/
recursive_is_even
713.00µs 708.66µs ⚪ -0.58% 1.49ms 1.39ms 🟢 -7.71% 🟡 96%
execute/
recursive_ok
103.61µs 102.97µs ⚪ 0.02% 204.18µs 199.67µs 🟢 -2.60% 🟡 94%
execute/
recursive_scan
140.49µs 136.65µs 🟢 -2.80% 253.22µs 261.59µs 🔴 2.99% 🟡 91%
execute/
recursive_trap
10.14µs 10.13µs ⚪ -0.11% 20.96µs 20.31µs ⚪ -1.54% 🔴 101%
execute/
regex_redux
466.98µs 467.49µs ⚪ -0.54% 967.31µs 1.04ms 🔴 8.76% 🔴 123%
execute/
rev_complement
426.87µs 433.63µs ⚪ 0.71% 994.09µs 1.04ms 🔴 3.44% 🔴 139%
execute/
tiny_keccak
316.51µs 345.53µs 🔴 8.51% 889.58µs 883.38µs ⚪ 1.27% 🔴 156%
execute/
trunc_f2i
741.48µs 739.47µs ⚪ -0.67% 1.90ms 2.03ms 🔴 6.33% 🔴 175%
instantiate/
wasm_kernel
53.16µs 53.09µs ⚪ 0.60% 60.72µs 68.26µs 🔴 8.07% 🟢 29%
translate/
erc1155
187.37µs 186.29µs ⚪ -0.81% 337.59µs 325.46µs 🟢 -3.37% 🟡 75%
translate/
erc20
91.57µs 91.38µs ⚪ 0.13% 171.13µs 163.67µs 🟢 -5.05% 🟡 79%
translate/
erc721
130.14µs 128.01µs 🟢 -1.71% 238.34µs 229.36µs ⚪ -2.71% 🟡 79%
translate/
spidermonkey
56.33ms 55.98ms ⚪ -0.69% 0.00ns 0.00ns ⚪ -1.08% 🟢 -100%
translate/
wasm_kernel
3.75ms 3.72ms ⚪ -0.65% 6.39ms 6.18ms 🟢 -3.97% 🟡 66%

Link to pipeline

@Robbepop Robbepop merged commit ed12feb into master Jul 31, 2023
12 checks passed
@Robbepop Robbepop deleted the rf-add-f64const32-instr branch July 31, 2023 08:40
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