[New-bugs-announce] [issue4565] io write() performance very slow

Istvan Albert report at bugs.python.org
Sat Dec 6 16:11:00 CET 2008

New submission from Istvan Albert <istvan.albert at gmail.com>:

The write performance into text files is substantially slower (5x-8x)
than that of python 2.5. This makes python 3.0 unsuited to any
application that needs to write larger amounts of data.

------------test code follows -----------------------

import time

lo, hi, step = 10**5, 10**6, 10**5

# writes increasingly more lines to a file
for N in range(lo, hi, step):
    fp = open('foodata.txt', 'wt')
    start = time.time()
    for i in range( N ):
        fp.write( '%s\n' % i)
    stop = time.time()
    print ( "%s\t%s" % (N, stop-start) )

components: Interpreter Core
messages: 77132
nosy: ialbert
severity: normal
status: open
title: io write() performance very slow
type: performance
versions: Python 3.0

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list