turbolent / w2c2

Translates WebAssembly modules to portable C
MIT License
712 stars 37 forks source link

Directly linking against imports #59

Closed Heath123 closed 1 year ago

Heath123 commented 1 year ago

The function pointer method for calling exports seems like it could interfere with inlining etc. if the compiler can't prove that they always have the same value. Could there be an option to directly link against them instead so that link time optimisation can speed the calls up, especially for small function like plotting individual pixels?

Heath123 commented 1 year ago

Also how does passing around this instance pointer everywhere compare to using a global which I think is how it used to work? Hopefully it gets optimised out where it's not used

Heath123 commented 1 year ago

I'll probably do a PR for this