joined_string = ''.join(testbuf for index in range(1000))
strings = []
for i in range(1000):
    strings.append(testbuf)
Python cStringIO take more time than StringIO in writing (performance of string methods)