3 Answers
3

The module cStringIO provides an
interface similar to that of the
StringIO module. Heavy use of
StringIO.StringIO objects can be made
more efficient by using the function
StringIO() from this module instead.

But the point of StringIO is to be a file-like object, for when something expects such and you don't want to use actual files.

Edit: I noticed you use from io import StringIO, so you are probably on Python >= 3 or at least 2.6. The separate StringIO and cStringIO are gone in Py3. Not sure what implementation they used to provide the io.StringIO. There is io.BytesIO too.

io.StringIO is a C implementation, if that exists on your platform. If not it uses a Python implementation fallback. The reason it's slower is because he is doing something that he doesn't need StringIO for in the first place.
–
Lennart RegebroJan 19 '11 at 10:14

If you want to create a bunch of strings, and then join them, meth1() is the correct way. There is no point in writing it to StringIO, which is something completely different, namely a string with a file-like stream interface.