Performance improvement for writing string literals