Message165978
> Under Windows (64-bit Windows 7 on a VirtualBox VM), the patch increases performance slightly but not as much as under Linux:
Thank you, Antoine. This is an expected result.
> And the join() approach is 10x faster (!):
> C:\t\cpython>pc\VS9.0\amd64\python.exe -m timeit -s "import io; n=2000; d=[b'a'*
> n,b'bb'*n,b'ccc'*n]*1000" "b''.join(d)"
> 100 loops, best of 3: 4.63 msec per loop
To be fair, test body should be: "s=[]; w=s.append" "for x in d: w(x)" "b''.join(s)"
May be tuning resize strategy (overallocate not 1/8, but 1/4, 1/2, or 100%) can help. |
|
Date |
User |
Action |
Args |
2012-07-20 20:48:26 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ncoghlan, pitrou, Arfrever, eli.bendersky, meador.inge, tshepang, jcon |
2012-07-20 20:48:26 | serhiy.storchaka | set | messageid: <1342817306.84.0.571987628744.issue15381@psf.upfronthosting.co.za> |
2012-07-20 20:48:26 | serhiy.storchaka | link | issue15381 messages |
2012-07-20 20:48:25 | serhiy.storchaka | create | |
|