optimized buffer handling and runtime optimization. The initial buffer size is set to 10 characters, so it doesn't have to be increased that often. If the buffer has to grow, just copy the identical pattern and not the whole string.