Message143732
| Author |
skrah |
| Recipients |
kristjan.jonsson, mark.dickinson, pitrou, scoder, skrah |
| Date |
2011年09月08日.16:03:32 |
| SpamBayes Score |
0.002697828 |
| Marked as misclassified |
No |
| Message-id |
<1315497812.69.0.113001086949.issue10227@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I see. I thought this was mainly about memoryview performance, so
I did not specifically look at bytearray. The poor performance seems
to be Windows specific:
C:\Users\stefan\hg\pep-3118\PCbuild>amd64\python.exe -m timeit -n 10000000 -s "x = ((b'x'*10000))" "x[:100]"
10000000 loops, best of 3: 0.118 usec per loop
C:\Users\stefan\hg\pep-3118\PCbuild>amd64\python.exe -m timeit -n 10000000 -s "x = (bytearray(b'x'*10000))" "x[:100]"
10000000 loops, best of 3: 0.191 usec per loop
C:\Users\stefan\hg\pep-3118\PCbuild>amd64\python.exe -m timeit -n 10000000 -s "x = memoryview(bytearray(b'x'*10000))" "x[:100]"
10000000 loops, best of 3: 0.146 usec per loop
Linux:
bytes: 10.9 usec bytearray: 0.14 usec memoryview: 0.14 usec |
|