A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-December/151298.html below:

[Python-Dev] Type creation speed

[Python-Dev] Type creation speed [Python-Dev] Type creation speedAntoine Pitrou solipsis at pitrou.net
Fri Dec 15 12:50:58 EST 2017
On Fri, 15 Dec 2017 19:18:11 +0200
Serhiy Storchaka <storchaka at gmail.com> wrote:
> 15.12.17 18:36, Antoine Pitrou пише:
> > Do you have any general idea how to speed up class creation?  
> 
> Some work was done in [https://bugs.python.org/issue31336]. Currently I 
> have no ideas.
> 
> Creating a class is 1-2 orders slower than creating a function. And 
> adding parent classes significantly slows down it.

I made simple, approximate measurements with an empty class:

- fixup_slot_dispatchers() takes 78% of the time (!)
- __build_class__() takes 5%
- computing the default __qualname__, __module__, __doc__ takes 3%
- set_names() takes 2.5%
- init_subclass() takes 2.5%

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4