posit-dev / shinylive

Run Shiny on Python and R (compiled to wasm) in the browser
https://shinylive.io/py/examples/
MIT License
211 stars 19 forks source link

Performance Differences between Chrome and Firefox #191

Open TobiasFellinger opened 3 days ago

TobiasFellinger commented 3 days ago

I observe huge performance differences between the same App running on Chrome (and similar browsers like Edge) and Firefox. I tested this on Windows, Linux and Android. I did not have the opportunity to check this on OsX and Safari.

I was not able to find out more details (I'm not a web developer) but it seems to be related to graphics output. I'm not sure if this is a web-r or shinylive problem if this has to be fixed on the browser level or if there's a way to avoid this by writing the shiny-app better.

The app I experince this with is in this Repo and is also hosted on github pages here.

wch commented 2 days ago

I'm able to reproduce this behavior on my Mac: on Chrome, in the Scenarios tab when I click the Redraw button, it takes about 1s for the plots to re-render. On Firefox, it's about 10s. (Note that the application is in R, so it is running in webR.)

The plots did not work on Safari for me: I get an error message in the JS console saying "Maximum stack size exceeded".

This is likely due to different implementations of their WASM engines, which we don't have control over. But I wonder if it we're hitting some particular speed bumps in their WASM implementation that could be avoided.