[Feature Request] Use binary data files instead of json
djytw opened this issue ยท 2 comments
Currently json is used to store the map data, and it's bandwidth consuming (ie. sometimes use a 20bytes String to represent a Float32). This is especially obvious when load overview (lowres data), since hires data is more "regular" and can be gzipped to a smaller size.
Also it may improve performance since there's no transform from binary(arraybuffer) to data(float32array), instead of String to float32.
I can help with that. A rewrite of BufferGeometryLoader is all that needed in JS side. Any thoughts on format?
The reason i used json files was, that they precisely represent a BufferGeometry from threejs. So the only thing the browser needs to do is a JSON.parse()
and it has an optimized ThreeJS BufferGeometry to work with.
However i see the potential performance improvements: From what i can find JSON.parse()
is not best in performance and reading binary data might be faster as well. A smaller bandwidth usage being the second improvement.
I have no experience with reading binary data with JS yet.. So this would take me extra time to learn and improve.
If someone with more JavaScript experience is willing to implement that, we could agree on a better format and i could do the necessary changes on the Java-end ^^