I'm writing a voxel octree engine whose memory is very intensive.
There will be enormous of indexes data on those octree nodes while I planning to use map data structure on those indexes.
However, Since I know my map key and value could be fit in 4 bytes per pair while if I use a built-in Map it will consume at least 16 bytes per pair, Since the number is 8 bytes each.
Any ideas or library on Map with memory-intensive in mind?
Update: Another idea I could go with..
I could possibly use the sorted array instead of a map.
And manage the array using ArrayBuffer instead of vanilla js array;
So I could access the element in O(log N) but will be able to granularity control the data layout.
Will leave the topic open cause it seems useful if anyone encountered this situation.