prismarine-viewer
prismarine-viewer copied to clipboard
Remove work from the main thread
I've been looking at the Lighthouse report for my viewer on 2b2t spawn (local, downloaded file), and the performance was terrible. Some of my findings after messing with the code:
- Making all event listeners (controls.js) passive reduces input lag
- AO is slower (models.js:202)
- Basic material is faster (entity.js:174, worldrenderer.js:16)
- With the rendering faster, the map also loaded faster
The last one is the most important one and the reason why some parts (rendering, io, etc) should be in another thread.
Here's an implementation example from a blog
Here's a test of time to load all chunks in 6 render distance. 1.15.1: 1m 51s My optimized version: 0m 28s
All done on a paper 1.12 server, on this world
do you plan to PR your optimized version?
When the reuse viewer pr gets merged, im going to add a simple renderer option
Also, the "optmised" version is just the findings applied