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

Optimize makeDynCall to avoid dynamic dynCall where possible #12741

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 9, 2020

Now the runtime dynCall is only used in places where the
signature is not known at compile time, such as embind or
(the internally unused) getFuncWrapper.

Followup to #12732

See: #12733

@juj
Copy link
Collaborator

juj commented Nov 9, 2020

Now the runtime dynCall is only used in places where the
signature is not known at compile time, such as embind or
(the internally unused) getFuncWrapper.

Move getDynCaller into embind.js which is the only place
it was used.

Hmm, while the above is is true for Emscripten code, what about external user JS code? Shouldn't we support the abstractions for general use, not just to enough to cover Emscripten API patterns?

@juj
Copy link
Collaborator

juj commented Nov 9, 2020

Also it looks like this will conflict with #12732, can that land first? (as it was posted first?)

@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 9, 2020

Also it looks like this will conflict with #12732, can that land first? (as it was posted first?)

Of course, this change was inspired by #12732, please go ahead and land that.

@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 9, 2020

Now the runtime dynCall is only used in places where the
signature is not known at compile time, such as embind or
(the internally unused) getFuncWrapper.
Move getDynCaller into embind.js which is the only place
it was used.

Hmm, while the above is is true for Emscripten code, what about external user JS code? Shouldn't we support the abstractions for general use, not just to enough to cover Emscripten API patterns?

This is an interesting point of discussion. I think there are two types of JS library functions that we might want to write but sadly I don't think have any way to distingish them today:

  1. Function that are used internally in our JS libraries, which are subject to change at any time and not really designed for external libraries to use

  2. Function who's interface we commit to and want to allow others to use.

In this case I'm not sure which type of function getDynCaller is. Regardless of the answer to that question I think it would be nice to be able to flag internal library functions that other libraries (especially external ones) are not exposed to.

@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 9, 2020

Looking more closely at getDynCaller, I only recently introduced it in #12059. And its location is not relevant to its visibility (sadly) so moving has not functional effect right?

@sbc100 sbc100 force-pushed the optimize_makeDynCall branch 2 times, most recently from d8a2dd9 to 3d436a8 Compare November 26, 2020 07:13
@sbc100 sbc100 changed the title Optimize makeDynCall to use dynCall_xx function directly where needed Optimize makeDynCall to avoid dynamic dynCall where possible Dec 1, 2020
@sbc100 sbc100 requested a review from kripken December 1, 2020 23:19
src/parseTools.js Show resolved Hide resolved
@sbc100 sbc100 force-pushed the optimize_makeDynCall branch 2 times, most recently from 2ac6688 to 5a4f6f9 Compare December 2, 2020 04:15
Now the runtime `dynCall` is only used in places where the
signature is not known at compile time, such as embind or
(the internally unused) `getFuncWrapper`.

Move `getDynCaller` into embind.js which is the only place
it was used.
@sbc100 sbc100 merged commit 496967e into master Dec 2, 2020
@sbc100 sbc100 deleted the optimize_makeDynCall branch December 2, 2020 07:12
kripken added a commit that referenced this pull request Mar 28, 2022
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.

3 participants