-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Always use bulkmemory memcpy and memset when available #20144
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
Conversation
Unlike the JS versions of these function there is no need to only use these for small inputs. Results of running the test_memcpy_128b test before and after this change: ``` v8-bulk: mean: 1.536 (+-0.071) secs median: 1.495 range: 1.471-1.650 (noise: 4.630%) (5 runs) size: 149291, compressed: 54249 ``` -> ``` v8-bulk: mean: 1.489 (+-0.117) secs median: 1.535 range: 1.268-1.606 (noise: 7.871%) (5 runs)- size: 148387, compressed: 53813- ``` See comments in #19128
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
I guess no significant code size changes since we don't measure there with bulk memory? Did you notice a code size change manually when using bulk memory?
Based on |
Nice! |
This function was renamed in emscripten-core#20144. This change updates/removes the remaining references.
Hi, |
Bulk memory is not enabled by default. It probably will be very soon but for now you can opt into using It will also automatically be enabled if you disabled support for older browser. See emscripten/tools/feature_matrix.py Lines 53 to 57 in 918e131
|
Thanks, I had already tried I've now verified that we're passing Are there other criteria I need to meet? Sorry if I'm wasting your time with something obvious, but I'm kind of stumped as to why it wouldn't get linked in unless it's being disabled by some other flag. For reference, here's the stdout from our last link step:
|
If I'm reading https://github.com/emscripten-core/emscripten/blob/918e131fae0b5c7b1d05a5c75d7e8e676c377713/tools/system_libs.py#L1307C7-L1307C16 correctly, it looks like We do use |
You should see See emscripten/tools/system_libs.py Lines 2296 to 2297 in 918e131
|
So from looking at my build logs, I'm running:
and if i
So the switch should be getting seen by emcc, and it seems like at some level it is being seen because For reference, here are the other two rsp files. You can see bulk-memory is in another one too, since I tried adding it there earlier:
|
I can't see why Can you try adding adding |
I see |
It should be |
You can see the setting getting set in the Lines 1349 to 1352 in 1201861
|
I'm confident that our emscripten is just too old since the commit(s) that added this bulkmem optimization aren't in it. I found an emscripten_revision.txt that, if accurate, indicates I wasted your time by misreading what version we're on (it looks like we're in the .34 range, which is definitely too old). Good lesson for the future to grep the actual files I have in my emsdk folder if something isn't working before I come here for help :) |
No worries! Glad it worked out. |
Emscripten expect the JS-host to provide this import since v3.1.46 and this PR: emscripten-core/emscripten#20144
Emscripten expect the JS-host to provide this import since v3.1.46 and this PR: emscripten-core/emscripten#20144
Emscripten expect the JS-host to provide this import since v3.1.46 and this PR: emscripten-core/emscripten#20144
Emscripten expect the JS-host to provide this import since v3.1.46 and this PR: emscripten-core/emscripten#20144
Emscripten expect the JS-host to provide this import since v3.1.46 and this PR: emscripten-core/emscripten#20144
Emscripten expect the JS-host to provide this import since v3.1.46 and this PR: emscripten-core/emscripten#20144
Emscripten expect the JS-host to provide this import since v3.1.46 and this PR: emscripten-core/emscripten#20144
Emscripten expect the JS-host to provide this import since v3.1.46 and this PR: emscripten-core/emscripten#20144
Unlike the JS versions of these function there is no need to only use these for small inputs.
Results of running the test_memcpy_128b test before and after this change:
->
See comments in #19128