Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-31336: Speed up type creation, which is highly dominated by slow dict lookups. #3279

Merged
merged 20 commits into from Oct 1, 2017

Commits on Sep 4, 2017

  1. Copy the full SHA
    0a865c9 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    c4779e3 View commit details
    Browse the repository at this point in the history
  3. Ignore any errors (however unlikely) that may happen during the mro c…

    …hained name lookups in _PyType_Lookup().
    Stefan Behnel committed Sep 4, 2017
    Copy the full SHA
    ff2ea63 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2017

  1. Extract non-caching code from _PyType_Lookup() to use it directly fro…

    …m update_one_slot().
    Stefan Behnel committed Sep 5, 2017
    Copy the full SHA
    76b1986 View commit details
    Browse the repository at this point in the history
  2. Avoid some useless overhead for the no-basetype case. If "object" eve…

    …r ceases to be a valid base type, there'll probably be larger code sections to change than this one.
    Stefan Behnel committed Sep 5, 2017
    Copy the full SHA
    6f98485 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2017

  1. Add comment.

    Stefan Behnel committed Sep 6, 2017
    Copy the full SHA
    d9b726e View commit details
    Browse the repository at this point in the history
  2. Avoid uselessly searching empty bases for a metaclass. This is quite …

    …common in Python 3 now.
    
    Also make the step from "return NULL" error handling to "goto error" reference cleanup explicit.
    Stefan Behnel committed Sep 6, 2017
    Copy the full SHA
    be15255 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2017

  1. Avoid unsafe handling of borrowed "mro" reference during hash() call.

    Distinguish between "error" and "error with exception" cases in _PyType_LookupUncached().
    Fix a reference leak of "mro" on lookup errors.
    Resolves issues found by Serhiy Storchaka.
    Stefan Behnel committed Sep 10, 2017
    Copy the full SHA
    0736226 View commit details
    Browse the repository at this point in the history
  2. Clean up code and formatting a little.

    Stefan Behnel committed Sep 10, 2017
    Copy the full SHA
    8bc783f View commit details
    Browse the repository at this point in the history
  3. Add braces for code style reasons.

    Stefan Behnel committed Sep 10, 2017
    Copy the full SHA
    66648dd View commit details
    Browse the repository at this point in the history
  4. Give internal helper function a local name that does not resemble (ex…

    …isting) API names.
    
    Suggested by Serhiy Storchaka.
    Stefan Behnel committed Sep 10, 2017
    Copy the full SHA
    85fb3ae View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2017

  1. Allow non-dict types for the class dict when looking up names and cal…

    …l PyObject_GetItem() for them.
    Stefan Behnel committed Sep 11, 2017
    Copy the full SHA
    09e716a View commit details
    Browse the repository at this point in the history
  2. Lazily calculate name hash in find_name_in_mro() to avoid potential r…

    …e-calculation if the mapping is not exactly a dict.
    Stefan Behnel committed Sep 11, 2017
    Copy the full SHA
    1d52082 View commit details
    Browse the repository at this point in the history
  3. Revert "Lazily calculate name hash in find_name_in_mro() to avoid pot…

    …ential re-calculation if the mapping is not exactly a dict."
    
    This reverts commit 1d52082.
    Stefan Behnel committed Sep 11, 2017
    Copy the full SHA
    f09bfd3 View commit details
    Browse the repository at this point in the history
  4. Revert "Allow non-dict types for the class dict when looking up names…

    … and call PyObject_GetItem() for them."
    
    This reverts commit 09e716a.
    Stefan Behnel committed Sep 11, 2017
    Copy the full SHA
    824d7cb View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2017

  1. add news entry for faster class creation

    Stefan Behnel committed Sep 13, 2017
    Copy the full SHA
    5184191 View commit details
    Browse the repository at this point in the history
  2. Change nice interface of "find_name_in_mro()" to evil interface eatin…

    …g lookup exceptions, just like "_PyType_Lookup()" did previously.
    Stefan Behnel committed Sep 13, 2017
    Copy the full SHA
    4efde8e View commit details
    Browse the repository at this point in the history
  3. Mention amount of speedup in News entry.

    Stefan Behnel committed Sep 13, 2017
    Copy the full SHA
    f5bce2a View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2017

  1. Revert "Change nice interface of "find_name_in_mro()" to evil interfa…

    …ce eating lookup exceptions, just like "_PyType_Lookup()" did previously."
    
    This reverts commit 4efde8e.
    Stefan Behnel committed Sep 14, 2017
    Copy the full SHA
    02bfef0 View commit details
    Browse the repository at this point in the history
  2. Guard against external live exceptions when calling find_name_in_mro(…

    …) from functions that swallow live exceptions.
    Stefan Behnel committed Sep 14, 2017
    Copy the full SHA
    2497858 View commit details
    Browse the repository at this point in the history