Skip to content

Investigate Python interpreter optimizations #8296

Description

@mhucka

Is your feature request related to a use case or problem? Please explain

One can build the CPython interpreter locally. The CPython build system has a number of build-time optimization flags available, and default Python installations may not have been built to take advantage of them. We should explore the options in case they can improve performance for Cirq. (Admittedly, any benefits from this may end up being hardware-dependent; nevertheless, even knowing that much would be useful.)

Describe the solution you would prefer

Rough first pass at an approach:

  1. make a list of the flags related to performance
  2. collect a representative set of platform choices (e.g., Linux on different x86_64 hosts that have different CPU instruction sets, windows, mac)
  3. collect a variety of sample Cirq programs
  4. make a script that iterates on the matrix of combinations of (1) × (2), builds CPython, runs the samples from (3), and collects timing data
  5. report the results

How urgent is this for you? Is it blocking important work?

P2 – we should do it in the next couple of quarters

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions