NASA-AMMOS / 3DTilesRendererJS

Renderer for 3D Tiles in Javascript using three.js
https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/mars.html
Apache License 2.0
1.47k stars 266 forks source link

Minor optimizations (TextDecoder, queueMicrotask) #541

Closed Nmzik closed 2 months ago

Nmzik commented 2 months ago

1) Replace Promise.resolve().then(...) with queueMicrotask(). (The queueMicrotask API has been implemented in all major browsers for 5-6 years now). 2) While profiling, I noticed a slight overhead when creating a new instance of TextDecoder for every tile while parsing the FeatureTable. Moving it out of the function scope completely eliminates its execution time when profiling.