optimizations during string read/write