This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dw
Recipients benjamin.peterson, dw, hynek, kmike, pitrou, scoder, serhiy.storchaka, skrah, stutzbach
Date 2014-07-24.22:56:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1406242576.25.0.369053959038.issue22003@psf.upfronthosting.co.za>
In-reply-to
Content
This new patch abandons the buffer interface and specializes for Bytes per the comments on this issue.

Anyone care to glance at least at the general structure?

Tests could probably use a little more work.

Microbenchmark seems fine, at least for construction. It doesn't seem likely this patch would introduce severe performance troubles elsewhere, but I'd like to trying it out with some example heavy BytesIO consumers (any suggestions? Some popular template engine?)

cpython] ./python.exe -m timeit -s 'import i' 'i.readlines()'
lines: 54471
100 loops, best of 3: 13.3 msec per loop

[23:52:55 eldil!58 cpython] ./python-nocow -m timeit -s 'import i' 'i.readlines()'
lines: 54471
10 loops, best of 3: 19.6 msec per loop

[23:52:59 eldil!59 cpython] cat i.py
import io
word = b'word'
line = (word * int(79/len(word))) + b'\n'
ar = line * int((4 * 1048576) / len(line))
def readlines():
    return len(list(io.BytesIO(ar)))
print('lines: %s' % (readlines(),))
History
Date User Action Args
2014-07-24 22:56:17dwsetrecipients: + dw, pitrou, scoder, benjamin.peterson, stutzbach, skrah, hynek, serhiy.storchaka, kmike
2014-07-24 22:56:16dwsetmessageid: <1406242576.25.0.369053959038.issue22003@psf.upfronthosting.co.za>
2014-07-24 22:56:16dwlinkissue22003 messages
2014-07-24 22:56:15dwcreate