[issue39168] Generic type subscription is a huge toll on Python performance

2020-11-15 Thread Guido van Rossum
Guido van Rossum added the comment: No worries. I tend to run each time it command at least three times before I trust the numbers. Professional bench markers also configure a machine without background tasks (email etc.). -- ___ Python tracker

[issue39168] Generic type subscription is a huge toll on Python performance

2020-11-15 Thread David Lord
David Lord added the comment: I'm using Arch Linux. After your reply I tried again and now I'm seeing the same result as you, negligible difference from inheriting `Generic` on Python 3.9. I can't explain it, I ran the timings repeatedly before I posted here, but I guess it was a weird

[issue39168] Generic type subscription is a huge toll on Python performance

2020-11-15 Thread Guido van Rossum
Guido van Rossum added the comment: @davidm I don't see such a dramatic difference -- the generic version is a tad slower, but the difference is less than the variation between runs. What platform are you using? (I'm doing this on Windows.) --

[issue39168] Generic type subscription is a huge toll on Python performance

2020-11-15 Thread David Lord
David Lord added the comment: Is this performance issue supposed to be fixed in 3.9? I'm still observing severe slowdown by inheriting from `Generic[T]`. I'm currently adding typing to Werkzeug, where we define many custom data structures such as `MultiDict`. It would be ideal for these

[issue39168] Generic type subscription is a huge toll on Python performance

2020-07-05 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39168] Generic type subscription is a huge toll on Python performance

2020-07-05 Thread miss-islington
miss-islington added the comment: New changeset 5a1384935ee8996a5bd240dd29f9b5e356cfc467 by Miss Islington (bot) in branch '3.9': bpo-39168: Remove the __new__ method of typing.Generic (GH-21327) https://github.com/python/cpython/commit/5a1384935ee8996a5bd240dd29f9b5e356cfc467 --

[issue39168] Generic type subscription is a huge toll on Python performance

2020-07-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +20483 pull_request: https://github.com/python/cpython/pull/21335 ___ Python tracker ___

[issue39168] Generic type subscription is a huge toll on Python performance

2020-07-04 Thread miss-islington
miss-islington added the comment: New changeset 7fed75597fac11f9a6c769e2b6c6548fe0e4049d by Zackery Spytz in branch 'master': bpo-39168: Remove the __new__ method of typing.Generic (GH-21327) https://github.com/python/cpython/commit/7fed75597fac11f9a6c769e2b6c6548fe0e4049d -- nosy:

[issue39168] Generic type subscription is a huge toll on Python performance

2020-07-04 Thread Guido van Rossum
Guido van Rossum added the comment: Should this be backported? How far back? -- ___ Python tracker ___ ___ Python-bugs-list

[issue39168] Generic type subscription is a huge toll on Python performance

2020-07-04 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 6.0 -> 7.0 pull_requests: +20477 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21327 ___ Python tracker

[issue39168] Generic type subscription is a huge toll on Python performance

2020-01-13 Thread Wouter De Borger
Change by Wouter De Borger : -- nosy: +Wouter De Borger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39168] Generic type subscription is a huge toll on Python performance

2020-01-11 Thread calebj
Change by calebj : -- nosy: +calebj ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39168] Generic type subscription is a huge toll on Python performance

2020-01-02 Thread Naveen Durai
Change by Naveen Durai : -- nosy: +Naveen Durai ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-31 Thread Ruslan Dautkhanov
Ruslan Dautkhanov added the comment: Didn't see your last response before submitting an update. That's great you have a plan how to resolve this! Thanks again -- ___ Python tracker

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-31 Thread Ruslan Dautkhanov
Ruslan Dautkhanov added the comment: Perhaps the check should only be done in some sort of Python development mode and off by default? -- ___ Python tracker ___

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-31 Thread Guido van Rossum
Guido van Rossum added the comment: OK let’s do it. Clearly for *some* applications the overhead is significant. -- --Guido (mobile) -- ___ Python tracker ___

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-31 Thread Ruslan Dautkhanov
Ruslan Dautkhanov added the comment: Thank you Guido and Ivan -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-31 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: OK, here is the original issue https://github.com/python/typing/issues/681. I asked the author to open an issue here instead, but likely they didn't open one. -- ___ Python tracker

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-31 Thread Guido van Rossum
Guido van Rossum added the comment: If that solves the perf issue I am fine with it. -- ___ Python tracker ___ ___

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-31 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: This issue came up few times before (although I can't find an issue here on b.p.o., maybe it was on typing-sig list). Although in micro-benchmarks the impact may seem big, in vast majority of applications it is rarely more that a percent or so. On the

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-30 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, here's what I measure in Python 3.8.1. (I don't use IPython or notebooks so this looks a little different.) >>> timeit.timeit('Foo()', 'class Foo: pass') 0.3763025619934 >>> timeit.timeit('Foo()', 'class Foo:\n def __new__(cls): return >>>

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-30 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, you already said 3.6 and 3.8 give the same effect. But what if you add a minimal __new__() to Foo? -- ___ Python tracker ___

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-30 Thread Guido van Rossum
Guido van Rossum added the comment: What Python version was used for the timings? If not 3.8, please do over in 3.8. -- ___ Python tracker ___

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-30 Thread Ruslan Dautkhanov
Ruslan Dautkhanov added the comment: In [12]: cProfile.run("for _ in range(100_000): Bar()") 23 function calls in 0.136

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-30 Thread Ned Deily
Change by Ned Deily : -- nosy: +gvanrossum, levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-30 Thread Ruslan Dautkhanov
Ruslan Dautkhanov added the comment: Python typing gives an order of magnitude slow down in this case -- ___ Python tracker ___

[issue39168] Generic type subscription is a huge toll on Python performance

2019-12-30 Thread Ruslan Dautkhanov
New submission from Ruslan Dautkhanov : Reported originally here - https://twitter.com/__zero323__/status/1210911632953692162 See details here https://asciinema.org/a/290643 In [4]: class Foo: pass In [5]: %timeit -n1_000_000 Foo() 88.5 ns ± 3.44 ns per loop (mean ± std. dev. of 7 runs,