Skip to content

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 24, 2020

Py_InitializeFromConfig() now always creates the empty tuple
singleton as soon as possible.

Optimize PyTuple_New(0): it no longer has to check if the empty tuple
was created or not, it is always creatd.

  • Add tuple_create_empty_tuple_singleton() function.
  • Add tuple_get_empty() function.
  • Remove state parameter of tuple_alloc().

https://bugs.python.org/issue40521

Py_InitializeFromConfig() now always creates the empty tuple
singleton as soon as possible.

Optimize PyTuple_New(0): it no longer has to check if the empty tuple
was created or not, it is always creatd.

* Add tuple_create_empty_tuple_singleton() function.
* Add tuple_get_empty() function.
* Remove state parameter of tuple_alloc().
@vstinner vstinner merged commit 0430dfa into python:master Jun 24, 2020
@vstinner vstinner deleted the tuple_empty branch June 24, 2020 13:21
fasih pushed a commit to fasih/cpython that referenced this pull request Jun 29, 2020
Py_InitializeFromConfig() now always creates the empty tuple
singleton as soon as possible.

Optimize PyTuple_New(0): it no longer has to check if the empty tuple
was created or not, it is always creatd.

* Add tuple_create_empty_tuple_singleton() function.
* Add tuple_get_empty() function.
* Remove state parameter of tuple_alloc().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants