[issue41732] Custom iterator to memoryview - performance improvement

2020-09-08 Thread Diogo Flores


Diogo Flores  added the comment:

Thank you Dong-hee Na and Victor.

@Stefan Krah: I am sorry that you didn't had the chace to try out the patch 
before it got merged, however iff you are curious about the any aspect of the 
implementation (or the motivation behind it) I am happy to discuss it in depth.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41732] Custom iterator to memoryview - performance improvement

2020-09-08 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Diogo Flores, it's a nice optimization!


Stefan Krah: "It would have been nice to have had a chance to look at this, but 
apparently those days are over."

The PR has been approved by two core developers. It's a nice optimization, I 
don't see what is the problem here.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41732] Custom iterator to memoryview - performance improvement

2020-09-08 Thread Dong-hee Na


Dong-hee Na  added the comment:

Thanks, Diogo for working on this issue.
And thank you for the mentoring guido!

--
nosy: +gvanrossum
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41732] Custom iterator to memoryview - performance improvement

2020-09-08 Thread Stefan Krah


Change by Stefan Krah :


--
nosy:  -skrah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41732] Custom iterator to memoryview - performance improvement

2020-09-08 Thread Stefan Krah


Stefan Krah  added the comment:

It would have been nice to have had a chance to look at this, but
apparently those days are over.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41732] Custom iterator to memoryview - performance improvement

2020-09-08 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset b0ac5d75a59c356c44cfc9b25077da3049dd16e9 by dxflores in branch 
'master':
bpo-41732: add iterator to memoryview (GH-22119)
https://github.com/python/cpython/commit/b0ac5d75a59c356c44cfc9b25077da3049dd16e9


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41732] Custom iterator to memoryview - performance improvement

2020-09-06 Thread Diogo Flores


Change by Diogo Flores :


--
keywords: +patch
pull_requests: +21203
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22119

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41732] Custom iterator to memoryview - performance improvement

2020-09-06 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +skrah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41732] Custom iterator to memoryview - performance improvement

2020-09-06 Thread Diogo Flores


New submission from Diogo Flores :

Hi,

Here's a patch that adds an iterator to memoryview, which makes iterating over 
memoryview objs considerably faster.

The following values result from a compilation with debug ON.



Without patch:

cpython: ./python.exe -m timeit -s "a=memoryview(b'x'*100)" "for x in a: 
pass"
5 loops, best of 5: 98 msec per loop

cpython: ./python.exe -m timeit -s "a=b'x'*100" "for x in a: pass"
5 loops, best of 5: 68.6 msec per loop


With patch:

cpython: ./python.exe -m timeit -s "a=memoryview(b'x'*100)" "for x in a: 
pass"
5 loops, best of 5: 68.1 msec per loop

cpython: ./python.exe -m timeit -s "a=b'x'*100" "for x in a: pass"
5 loops, best of 5: 70 msec per loop



Please let me know your thoughts regarding it.

Diogo

--
messages: 376460
nosy: dxflores
priority: normal
severity: normal
status: open
title: Custom iterator to memoryview - performance improvement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com