This PR adds the first bit of Rust (compiled to wasm) to Glimmer. All tests pass in Chrome and Firefox, investigating Edge and Safari.
https://github.com/glimmerjs/glimmer-vm/pull/752 …
It uses https://github.com/glimmerjs/broccoli-rust2wasm … -- which can be used in any Broccoli/EmberCLI project! #itshappening
-
-
Replying to @wycats @stefanpenner
I have a hard time seeing how this could possibly be faster, with all the indirection and transitions between wasm and JS. Are there benchmarks to indicate this as promising?
3 replies 0 retweets 6 likes -
I thought the same thing here is an evented parser stressing the bridge in the latest v8 the bridge is fast https://github.com/krisselden/fast-source-map/tree/wasm/bench …
1 reply 2 retweets 5 likes -
Got numbers handy?
2 replies 0 retweets 1 like -
Yeah, I remain pretty skeptical, at least in the absence of numbers. This is just not the kind of stuff wasm is designed to be good at, and not something I'd expect it to be better than a JS optimizing compiler on.
2 replies 0 retweets 2 likes -
I see lots of ways (even if the bridge is costly) this could be used for a nice win.
2 replies 0 retweets 0 likes -
Replying to @stefanpenner @domenic and
Especially if work is batched and what is passed between wasm and js doesn’t require complex wrappers (a binary blob)
1 reply 0 retweets 0 likes -
I just see no reason to believe the machine code produced by wasm would be more efficient than the machine code produced by the JIT, for this kind of code. Happy to be proved wrong!
2 replies 0 retweets 4 likes -
Replying to @domenic @stefanpenner and
@wycats argument on this is roughly "consistent expectations". Less that we expect improved top speed, more that we see less hits from ejects1 reply 0 retweets 1 like -
Replying to @Runspired @stefanpenner and
Why would this code "eject", ever? (I assume you mean deopt.)
3 replies 0 retweets 0 likes
Maintaining good performance from low level JS code intended to hit happy paths has proven challenging. It is also a major source of mistakes caused by contributors. Top-speed JS JIT is fast, but it's hard to reliably hit.
-
-
It also doesn't have to deopt. There can be multiple opt steps as more type information is gathering as more paths get exhausted. That makes it even more difficult to predict. WASM vs JS characteristics varies a lot based on browser though.
0 replies 0 retweets 4 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.