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

Implement resumable calls for TypedFunc #605

Merged
merged 2 commits into from
Jan 6, 2023
Merged

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Jan 6, 2023

So far the resumable calls feature was only available for the untyped Func type but not the statically typed TypedFunc type.
The reason for this was non-technical and therefore this follow-up PR adds this missing functionality.
The PR also simplifies the API for Func::call_resumable a bit and slightly improves docs.

ToDo

  • Write tests for TypedFunc::call_resumable.

@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Jan 6, 2023

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.46ms 1.35ms 🔴 -7.03% 1.13ms 1.14ms 🟢 0.41% 🟢 -16%
execute/
bare_call_0/typed
970.88µs 998.16µs 🔴 3.16% 737.18µs 720.37µs 🟢 -2.37% 🟢 -28%
execute/
bare_call_1
1.52ms 1.42ms 🔴 -7.11% 1.37ms 1.34ms 🔴 -2.64% 🟢 -5%
execute/
bare_call_16
2.44ms 2.44ms ⚪ 0.36% 4.19ms 4.19ms 🟢 0.05% 🟡 71%
execute/
bare_call_16/typed
1.57ms 1.58ms ⚪ 0.39% 2.39ms 2.34ms 🟢 -3.95% 🟢 47%
execute/
bare_call_1/typed
1.06ms 1.10ms 🔴 4.43% 1.07ms 1.11ms 🔴 3.87% 🟢 1%
execute/
bare_call_4
1.59ms 1.58ms 🟢 -1.20% 1.98ms 1.97ms ⚪ -0.36% 🟢 25%
execute/
bare_call_4/typed
1.08ms 1.08ms ⚪ -0.05% 1.18ms 1.17ms ⚪ -0.63% 🟢 8%
execute/
br_table
1.13ms 1.11ms ⚪ -2.21% 1.35ms 1.31ms ⚪ -2.51% 🟢 17%
execute/
count_until
683.07µs 682.01µs ⚪ -0.07% 2.14ms 2.14ms ⚪ -0.05% 🔴 214%
execute/
factorial_iterative
322.11µs 327.61µs 🔴 1.68% 882.41µs 882.88µs ⚪ -0.01% 🔴 169%
execute/
factorial_recursive
626.34µs 637.01µs 🔴 1.89% 1.50ms 1.51ms ⚪ 0.42% 🔴 136%
execute/
fib_iterative
1.43ms 1.43ms ⚪ 0.27% 4.63ms 4.63ms ⚪ -0.20% 🔴 223%
execute/
fib_recursive
5.71ms 5.73ms ⚪ 0.48% 13.26ms 13.15ms ⚪ -0.67% 🔴 129%
execute/
global_bump
1.07ms 1.07ms ⚪ 0.15% 3.21ms 3.21ms ⚪ -0.17% 🔴 199%
execute/
global_const
717.95µs 716.73µs ⚪ -0.16% 2.54ms 2.49ms 🟢 -2.09% 🔴 247%
execute/
host_calls
29.14µs 35.50µs 🔴 21.98% 42.74µs 42.44µs ⚪ -0.61% 🟢 20%
execute/
memory_fill
1.31ms 1.30ms ⚪ -0.13% 4.12ms 4.12ms ⚪ -0.06% 🔴 216%
execute/
memory_sum
1.31ms 1.31ms ⚪ 0.06% 4.21ms 4.21ms ⚪ 0.08% 🔴 221%
execute/
memory_vec_add
2.66ms 2.66ms ⚪ -0.05% 8.58ms 8.60ms ⚪ 0.16% 🔴 223%
execute/
recursive_is_even
1.21ms 1.18ms ⚪ -2.58% 2.36ms 2.35ms ⚪ -0.20% 🟡 100%
execute/
recursive_ok
144.84µs 143.80µs ⚪ -0.69% 342.35µs 342.03µs ⚪ 0.03% 🔴 138%
execute/
recursive_scan
181.68µs 179.70µs ⚪ -1.11% 441.11µs 440.37µs ⚪ -0.27% 🔴 145%
execute/
recursive_trap
14.23µs 14.35µs ⚪ 0.62% 31.67µs 31.72µs ⚪ 0.04% 🔴 121%
execute/
regex_redux
558.88µs 565.52µs ⚪ 1.04% 1.55ms 1.56ms ⚪ 0.38% 🔴 175%
execute/
rev_complement
508.58µs 512.60µs ⚪ 0.74% 1.53ms 1.53ms ⚪ -0.24% 🔴 198%
execute/
tiny_keccak
364.49µs 368.92µs 🔴 1.26% 1.23ms 1.24ms ⚪ 0.73% 🔴 235%
execute/
trunc_f2i
915.70µs 915.79µs ⚪ -0.06% 2.62ms 2.63ms ⚪ 0.15% 🔴 187%
instantiate/
wasm_kernel
62.29µs 62.64µs 🔴 3.12% 70.80µs 72.33µs 🔴 2.30% 🟢 15%
translate/
erc1155
212.70µs 213.38µs ⚪ 0.10% 405.57µs 404.06µs ⚪ -0.55% 🟡 89%
translate/
erc20
102.46µs 103.69µs ⚪ 1.07% 197.67µs 199.60µs ⚪ 0.94% 🟡 92%
translate/
erc721
149.42µs 148.68µs ⚪ -0.58% 286.90µs 288.53µs ⚪ 0.52% 🟡 94%
translate/
spidermonkey
0.00ns 0.00ns ⚪ -0.24% 0.00ns 0.00ns ⚪ 0.50% 🟢 0%
translate/
wasm_kernel
3.84ms 3.83ms ⚪ -0.25% 7.72ms 7.79ms ⚪ 1.01% 🔴 103%

Link to pipeline

@Robbepop Robbepop merged commit 7753fab into master Jan 6, 2023
@Robbepop Robbepop deleted the rf-typed-call-resumable branch January 6, 2023 16:18
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