This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ruslan Dautkhanov
Recipients Ruslan Dautkhanov
Date 2019-12-30.17:17:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1577726230.5.0.713641828615.issue39168@roundup.psfhosted.org>
In-reply-to
Content
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, 1000000 loops each)

In [6]: T = TypeVar("T")
In [7]: class Bar(Generic[T]): pass
In [8]: %timeit -n1_000_000 Bar()
883 ns ± 3.46 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)

Same effect in Python 3.6 and 3.8
History
Date User Action Args
2019-12-30 17:17:10Ruslan Dautkhanovsetrecipients: + Ruslan Dautkhanov
2019-12-30 17:17:10Ruslan Dautkhanovsetmessageid: <1577726230.5.0.713641828615.issue39168@roundup.psfhosted.org>
2019-12-30 17:17:10Ruslan Dautkhanovlinkissue39168 messages
2019-12-30 17:17:10Ruslan Dautkhanovcreate