DEV Community

GopherJS vs WebAssembly for Go

Hajime Hoshi on June 15, 2018

EDIT: For the latest of GopherJS/Wasm comparison, see Wasm benchmark result Hi all! This article describes about my experiment of the new WebA...
Collapse
 
agnivade profile image
Agniva De Sarker

Can you try replacing setTimeout in L307 of wasm_exec.js (github.com/golang/go/blob/master/m...) with requestAnimationFrame and see if that gives any boost in performance ?

Collapse
 
hajimehoshi profile image
Hajime Hoshi

Thanks, I'll try. I'm worried that this might conflict with rAF on the game side.

Collapse
 
hajimehoshi profile image
Hajime Hoshi

My worry was right: FPS is now up to 30 when the number of sprites are small (e.g. 100 or so), while FPS was 60 before the fix.

Thread Thread
 
agnivade profile image
Agniva De Sarker

Got it. Thanks for giving it a shot.

Collapse
 
eli profile image
Eli Bierman

This was really interesting to read! I also expected WebAssembly to be faster. I'm definitely going to look into GopherJS and Ebiten.