Memory optimal Small String Optimization implementation