Author skrah
Recipients kristjan.jonsson, mark.dickinson, pitrou, scoder, skrah
Date 2011-09-08.16:03:32
SpamBayes Score 0.00269783
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
History
Date User Action Args
2011-09-08 16:03:32skrahsetrecipients: + skrah, mark.dickinson, pitrou, scoder, kristjan.jonsson
2011-09-08 16:03:32skrahsetmessageid: <1315497812.69.0.113001086949.issue10227@psf.upfronthosting.co.za>
2011-09-08 16:03:32skrahlinkissue10227 messages
2011-09-08 16:03:32skrahcreate