Some people have mentioned that memcpy
and memmove
functions are hot
when profiling some WebAssembly benchmarks. Some examples:
I've been looking at perf profiles for wasm unity benchmark a bit recently and see that some
doing stuff... | |
doing stuff... | |
chunk 0: used: 50000 size: 65536 | |
chunk 1: used: 37020 size: 65536 | |
chunk 2: used: 51000 size: 65536 | |
chunk 3: used: 44000 size: 65536 | |
chunk 4: used: 58000 size: 65536 | |
chunk 5: used: 63000 size: 65536 | |
chunk 6: used: 41000 size: 65536 | |
chunk 7: used: 56000 size: 65536 |
{"modules": [ | |
{"filename": "switch-spec.0.wasm", "commands": [ | |
{"type": "assert_return", "name": "$assert_return_0", "file": "third_party/testsuite/switch.wast", "line": 125}, | |
{"type": "assert_return", "name": "$assert_return_1", "file": "third_party/testsuite/switch.wast", "line": 126}, | |
{"type": "assert_return", "name": "$assert_return_2", "file": "third_party/testsuite/switch.wast", "line": 127}, | |
{"type": "assert_return", "name": "$assert_return_3", "file": "third_party/testsuite/switch.wast", "line": 128}, | |
{"type": "assert_return", "name": "$assert_return_4", "file": "third_party/testsuite/switch.wast", "line": 129}, | |
{"type": "assert_return", "name": "$assert_return_5", "file": "third_party/testsuite/switch.wast", "line": 130}, | |
{"type": "assert_return", "name": "$assert_return_6", "file": "third_party/testsuite/switch.wast", "line": 131}, | |
{"type": "assert_return", "name": "$assert_return_7", "file": "third_party/testsuite/switch.wast", "line": 132}, |
;; Convert this to add.wasm by running: | |
;; | |
;; wat2wasm add.wat -o add.wasm | |
;; | |
(module | |
(func (export "add") (param i32 i32) (result i32) | |
get_local 0 | |
get_local 1 | |
i32.add)) |
62676140: write_apu :(0x10 [NR41], 0x1) | |
62676160: write_apu :(0x11 [NR42], 0xf0) | |
62676180: write_apu :(0x12 [NR43], 0xe0) | |
62676180: write_noise_period :divisor: 8 clock shift: 14 period: 131072 | |
62676268: write_apu :(0x13 [NR44], 0x80) | |
62676268: write_noise_period :divisor: 8 clock shift: 14 period: 131072 | |
62676268: trigger_nrx4_envelope :(0x13 [NR44]) volume=15, timer=8 | |
62677172: write_apu :(0x14 [NR50], 0x44) | |
62677768: write_apu :(0x14 [NR50], 0x44) | |
62678356: write_apu :(0x14 [NR50], 0x44) |
4.2.12. Refers to the stack containing three kinds of entries "values", "labels", and "activations". Section 4.2.12.1 is called "Values", section 4.2.12.2 is called "Labels" but section 4.2.12.3 is called "Frames" instead. | |
4.2.12.3. The return arity is named but not labeled here. "Activation frames carry the return arity of the respective function". It should be the same as label above where `n` is mentioned explicitly. | |
4.2.13. "ultimately reducing the entire program to a single trap instruction", this isn't true when calling out to the embedder, right? | |
4.2.13. Note #3. The link for the label reduction rule is broken, it should go to 4.4.6.2. Also, the rule is different in the note. | |
4.2.13.2. What does "home" mean in "home module instance"? |
c701 6f06 a004 4027 0908 0000 0e00 0080 | |
d401 e000 a002 2402 0900 118c d002 400b | |
0009 d002 402b 0009 0e00 04b0 0000 0604 | |
2fe6 4f22 d324 430b 0009 d324 430b 0009 | |
d323 430b 0009 d323 430b 0009 d322 430b | |
0009 ee00 d321 430b 0009 7e01 e207 3e23 | |
8bf8 d31f 430b 0009 d01e a00d 6001 d31e | |
430b 0009 a00e 0009 b058 0009 a00a 0009 | |
b00a 0009 a006 0009 8800 89f0 8801 89f3 | |
8802 89f5 afe8 0009 4f22 d014 a035 6001 |
Some people have mentioned that memcpy
and memmove
functions are hot
when profiling some WebAssembly benchmarks. Some examples:
I've been looking at perf profiles for wasm unity benchmark a bit recently and see that some
No.
No.
2.2. Added Global object cache | |
3."asynchronously compile a WebAssembly module". Add step 1 "Let promise be a new promise". | |
3."asynchronously compile a WebAssembly module". Add step 4 "Return promise". | |
3."compile a WebAssembly module". Change step 2 to unwrap promise. | |
3."instantiate a WebAssembly Module". add support for imported/exported mutable globals. | |
3.3. Remove note "Any attempts to detach buffer..." | |
3.3. Add algorithm "reset the Memory buffer", refactor `memory.grow` and `grow_memory` instruction to use this. | |
3.4."create a table object". Add step to fetch associated store. | |
3.5. Add "Globals" section, defining WebAssembly.Global type. | |
3.6."new Exported Function". Change step 11 to call `SetFunctionLength`. |