-
Notifications
You must be signed in to change notification settings - Fork 30k
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
wasi: use WasmMemoryObject handle for perf #43544
Conversation
Review requested:
|
0424be9
to
49c3b76
Compare
d7ead7a
to
5a05d10
Compare
|
||
Local<ArrayBuffer> ab = prop.As<ArrayBuffer>(); | ||
std::shared_ptr<BackingStore> backing_store = ab->GetBackingStore(); | ||
Local<WasmMemoryObject> memory = PersistentToLocal::Strong(this->memory_); |
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.
tiny and very ignorable style nit:
Local<WasmMemoryObject> memory = PersistentToLocal::Strong(this->memory_); | |
Local<WasmMemoryObject> memory = PersistentToLocal::Strong(memory_); |
More directly, why are we not going on step further and storing the std::shared_ptr<BackingStore>
here? That should be even faster.
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.
the arraybuffer gets detached every time the wasm grows its memory. very annoying problem, maybe it will be fixed one day: https://github.com/tc39/proposal-resizablearraybuffer#sync-up-capability-with-webassembly-memorygrow
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
c440735
to
98a1262
Compare
PR-URL: #43544 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
98a1262
to
4778831
Compare
PR-URL: #43544 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: #43544 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: #43544 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: #43544 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Store
WebAssembly.Memory
handle as aWasmMemoryObject
, which lets us directly grab theArrayBuffer
instead of doing a property lookup in this hot path.