Open muthusampath opened 3 years ago
From the "something obvious" departement, it's pretty clear that Firefox is simply a slower browser when it comes to executing Cesium's JavaScript code. Opening the same scene in Chrome vs Firefox produces the same number of requests, same number of tiles and data transfered, same resulting image. It's just way slower.
Firefox does have some WebGL warnings in the console output so there is a chance that something is happening on the WebGL side that is causing a slower frame rate which transfers to slower tile loading due to time slicing.
There's still a non-trivial chance that the answer is "Firefox is just slower", but we should prove it and write up issues in their bug tracker if so.
One recent improvement to note here is that Firefox 93 shipped with support for the imageOrientation
flag for ImageBitmap
which means we can now take advantage of ImageBitmap
on Firefox. If you upgrade to Firefox 93 you should see less frame rate hitches when loading images of all kinds (Bing Maps, textured 3D Tiles, etc).
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/93
But everything that @mramato said is still relevant too.
And just for clarification, my testing was on Firefox 93 so it was likely even slower before that.
I'm not sure if FF performance charts are that different than Chrome, but an initial quick test showed ~43% of the time being spent in the DOM, which sounds really wrong. One stab in the dark would be if we are doing anything (such as getting client bounding width) every frame in a way that causes continuous reflow in FF and therefore abysmal performance.
But like I said, that's a stab in the dark. Whoever looks into this should do a full analysis before trying to change anything.
Example: https://cesium.com/ion/stories/viewer/?id=70b05989-eb6a-435b-8a65-021a633c888c
Browser: Firefox 92.0
Operating System: Windows 10 (Intel UHD Graphics 750)
Notes: Observed similar behavior in Firefox under Ubuntu with NVIDIA graphics card