-
Notifications
You must be signed in to change notification settings - Fork 85
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
Consider Pure JS Transpilation #155
Comments
Do you mean "readable JS" transpiration, like ReScript (ex Reason) or , or asm.js-style compilation (WASM precursor, the fastest JS subset, a target for compiling, say, C)? As for Percy specifically... Percy uses a virtual DOM. The vdom strategy has an unavoidable intrinsic cost. Perhaps there is still a meaningful overhead to WASM-JS ffi, which is how solid.js still beats rust-dominator, despite not even having a However, they both beat the fastest vdom libraries, such as Inferno, for updates, because they avoid a vdom entirely, and instead use reactive signals, which necessarily provide a slightly different end-user API than vdom libraries tend to. (This actually gives a mindful user even more optimization potential.) |
(Quote)
I haven't done any benchmarking, but I suspect that the rate-limiting factor is DOM API calls, which until interface types are implemented should be slower than JS.
That being said.. Benchmarks would definitely be useful as a way to help the libraries trend towards being more efficient over time. (as long as it isn't at the expense of usability.)
Originally posted by @chinedufn in #153 (comment)
Until native DOM access is implemented, I imagine it could be faster to manipulate the DOM by transpiling our Rust to pure JS to remove the interop bottleneck. This of course would need to be verified with performance metrics. Even after WebASM has been given native DOM access I believe this would be a really good feature for browsers that don't have WebASM enabled/implemented as a fallback mode.
Edit: I know this might be a large task, and I haven't looked at the feasibility of transpilation between Rust and JS, I do think it's worth looking at this though
The text was updated successfully, but these errors were encountered: