4 ms·
Mostly sounds like a case of fixing up some non-optimal defaults - the real hard part is gathering data from real world use cases which is required to make your
by blinkingled 10y ago
Mostly sounds like a case of fixing up some non-optimal defaults - the real hard part is gathering data from real world use cases which is required to make your defaults better.
1) Reducing the V8 heap page size from 1M to 512KB ... results in 2x memory reduction
2) The memory visualization tool helped us discover that the background parser would keep an entire zone alive long after the code was already compiled. ... resulted in reduced average and peak memory usage.
3) C++ compiler not packing structs optimally for V8s case - manual packing saves some peak memory.
- deleted 10y ago[deleted]
- williadc 10y agoI'm not familiar with the "packing" concept. How does one go about manual packing? How does it affect maintenance?
- blinkingled 10y agoCompilers typically align struct fields to a boundary to favor execution speed. This may be good for most use cases where there aren't thousands of instances of that struct wasting a lot of memory making it a bad tradeoff. So C/C++ compilers allow you turn this off either by specifying the data length yourself (bit fields) and/or specifying attribute(__packed__) directive in the case of GCC for example. In this case the packed directive resulted in suboptimal packing so they must have gone with bit fields I suppose to do manual packing.
- puzzle 10y agoOr you might also rearrange fields of the same type to be together.
- deleted 10y ago[deleted]
- Lozzer 10y agohttp://www.catb.org/esr/structure-packing/ http://www.catb.org/esr/structure-packing/