optimize write performance