tempfile.TemporaryFile vs. StringIO
问题 I've written a little benchmark where i compare different string concatenating methods for ZOCache. So it looks here like tempfile.TemporaryFile is faster than anything else: $ python src/ZOCache/tmp_benchmark.py 3.00407409668e-05 TemporaryFile 0.385630846024 SpooledTemporaryFile 0.299962997437 BufferedRandom 0.0849719047546 io.StringIO 0.113346099854 concat The benchmark code i've been using: #!/usr/bin/python from __future__ import print_function import io import timeit import tempfile