Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Extend and improve LOAD_COMMON_CONSTANT #148871

Copy link
Copy link
@markshannon

Description

@markshannon
Issue body actions

Currently LOAD_COMMON_CONSTANT only loads 7 not-so-common constants and does so fairly inefficiently.

It could be improved in two ways:

  • Add some more constants, especially None, but also "", True, False and -1
  • Make the constants that it does load both statically allocated and immortal to avoid the pointer chasing and incref operation. Only any and all would need changing.

After some consideration, I think it best to leave the common constants table per interpreter, and not statically allocate them.

  • The changes to any and all may be breaking.
  • We also need to handle AssertionError and NotImplementedError will be tricky to make static

They should all be immortal though, and stored as _PyStackRefs not PyObject *s.

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.