Skip to content

Extend and improve LOAD_COMMON_CONSTANT #148871

@markshannon

Description

@markshannon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions