-
Notifications
You must be signed in to change notification settings - Fork 24
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
Performance Estimates? #9
Comments
Not completely sure how to respond. However the js promise integration effort is proceeding well. |
For a slightly different perspective: The other cost is sync vs async API calls, e.g. speed/latency of a read call, independent of the suspend/resume cost. For example, if a read call that could return its result in just a millisecond or 2 has to wait for a turn of the event loop (plus other events that may fire?), is that a significant cost? Does the event loop run as soon as the result is available or does it have to wait for e.g. the next frame? IIUC the cost to the user (i.e. difference in latency between a sync and async call) will be the sum of these (suspension plus event loop plus resumption). Apologies if this is all obvious to you and you've already considered this carefully; I haven't been following the discussion closely. But it made me curious about it because it could be the case that if the cost from async alone is high enough, then it doesn't matter how fast suspension and resumption are. It also brings up a question for @fgmccabe: the cost of a suspend and resume in asyncify is linear in the depth of the stack at the time of the call. Hopefully that's not the case for JSPI? *actually there's also a 3rd component which is binary size. That cost is high enough to be a showstopper for many applications, but JSPI also mitigates it. |
Actually, the cost of suspend & resume in JSPI is constant. To be more precise, it is linear in the length of JSPI chain (the chain of modules a given Promise has to be propagated through before it gets to the browser's event loop). Normally, the length of this chain is 1. |
Hello. Over in whatwg/fs#7 there's a lot of pressure to make our new, upcoming, finally-lets-do-it-right file system api sync, because everyone wants their sqlite to run fast in a browser (a previous issue in the thread). Fair enough!
I apologize for the nosy ask, and I'm not really sure if this work can directly help speed up or replace asyncify or not. But might it? Are there any benchmarks on what improvements we've seen elsewhere? I'm not sure if we even base a baseline stack-switching v8 to test or not. Sorry again. But I'm hoping we can maybe get a little bit better an informed decision on how to shape the web's upcoming file api, and this work here seems like one of the most pertinent & relevant factors that could tip things one way or another. Thank you.
The text was updated successfully, but these errors were encountered: