Hi!
I’ve noticed that there seems to be a difference in performance when using CesiumJS as an NPM-module compared to using it in a static HTML-page.
I have set up a simple version of the iModel Sandcastle-demo as a webpack-build here:
https://mborjesson-bentley.github.io/cesiumimodeldemo/
On my machine this demo has around 40 FPS when idling in the start view.
For comparison I also set up the same version of the demo in a static HTML-page here:
https://mborjesson-bentley.github.io/cesiumimodeldemo/index2.html
This demo has a constant 60 FPS on my machine.
The webpack-demo was based on the official webpack5-example from here: cesium-webpack-example/webpack-5 at main · CesiumGS/cesium-webpack-example · GitHub
I removed the pragmas and built it by running npm build. The source for it can be found here: GitHub - mborjesson-bentley/cesiumimodeldemo
Is there anything else I need to do to improve the performance?
I ran the demos in Google Chrome 135.0.7049.52 on a Linux-machine running Ubuntu 22.04. GPU is an NVIDIA GeForce RTX 2070.
Thanks!
Hey @mborjesson, thanks for the question, sorry it’s not working as expected.
When I load your example pages I don’t notice a difference in FPS on my machine. I would not expect there to be a difference between builds and there shouldn’t be any settings you need to change beyond the ones already indicated in the cesium-webpack-example
.
Do you notice the performance difference when run locally in dev and the built version? Or is it only the deployed version?
Hi @jjspace, thanks for your reply!
No there is no difference when running locally in dev or the built version, I’m getting the exact same performance.
I did some testing on another machine with similar specifications and got much better performance there, so I’m currently suspecting there might be something wrong with my machine. I’ll investigate some more and I’ll return to this thread if I find out anything.
Thanks!
@mborjesson It does sound like it could be the machine itself. I’d suggest you also check https://webglreport.com/ and see if there are any differences. Feel free to post the results of that here too.