Message223907
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(),)) |
|
Date |
User |
Action |
Args |
2014-07-24 22:56:17 | dw | set | recipients:
+ dw, pitrou, scoder, benjamin.peterson, stutzbach, skrah, hynek, serhiy.storchaka, kmike |
2014-07-24 22:56:16 | dw | set | messageid: <1406242576.25.0.369053959038.issue22003@psf.upfronthosting.co.za> |
2014-07-24 22:56:16 | dw | link | issue22003 messages |
2014-07-24 22:56:15 | dw | create | |
|