title: JS, implement Map with optimized data layout
body: <p>I'm writing a voxel octree engine whose memory is very intensive.</p>
  <p>There will be enormous of indexes data on those octree nodes while I planning to use map data structure on those indexes.</p>
  <p>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.</p>
  <p>Any ideas or library on Map with memory-intensive in mind?</p>
  <hr />
  <p>Update: Another idea I could go with..</p>
  <p>I could possibly use the sorted array instead of a map.</p>
  <p>And manage the array using ArrayBuffer instead of vanilla js array;</p>
  <p>So I could access the element in O(log N) but will be able to granularity control the data layout.</p>
  <hr />
  <p>Will leave the topic open cause it seems useful if anyone encountered this situation.</p>