syscall/js: wasm perf question

136 views
Skip to first unread message

atd...@gmail.com

unread,
May 31, 2022, 9:19:24 AM5/31/22
to golang-nuts
Hi,

I am trying to optimize some wasm code that runs into the browser.
So far, the performance is acceptable if not slightly faster than probably unoptimized js DOM manipulation (comparing my implementation of TODOMVC with the vanilla javascript one and react one)

One issue I see is that  triggering event handlers that calls into wasm seem to incur a big overhead penalty (~25ms)

Any idea if this is normal and ways to alleviate it if so? (I haven.t tried using tinyGo yet)

You can find a screenshot of the perf profile here : CDT Perf Profile screenshot

Many thanks,

atd...@gmail.com

unread,
Jun 1, 2022, 2:51:43 PM6/1/22
to golang-nuts
Seems like it might be a slow handling of wasm in Chrome. Firefox is almost twice as fast. There seems to be almost no overhead.

atd...@gmail.com

unread,
Jun 2, 2022, 8:35:29 AM6/2/22
to golang-nuts
Really weird, for a same TODOMVC react app, Chrome (101.0.4951.64)  seems to be faster than Firefox (77.0.1) at handling a same DOM event (~12ms vs ~30ms).
But with my implementation of the same TODOMVC app in wasm, built with Go, the same event is handled much faster in Firefox than in Chrome (~25ms vs ~50+ms). 
(And actually wasm event handling is slightly faster than the handling of the same event in react)

Mostly seems to me like calling into wasm has close to no overhead in Firefox.

Anyone noticed something similar? Perhaps that it warrants a report.
Reply all
Reply to author
Forward
0 new messages