Skip to content

Optimize circuit construction when Insert is used #7464

@daxfohl

Description

@daxfohl

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

#6882 created a cache that sped up circuit construction if only "append" (or equivalent "insert" at end w/ EARLIEST strategy) was used. But fi an op is inserted into the middle of the circuit, the cache is simply deleted and subsequent mutations (including appends) fall back to the old "check every moment" algorithm.

Describe the solution you would prefer

Add two method to the placement cache, to tell it when an op has been added to a moment, or a moment has been inserted into the middle of the circuit, and have it update its dictionaries accordingly. Then have Circuit.insert call those methods when it adds an op to a moment or inserts a moment into a circuit, instead of deleting the cache entirely.

This will allow the cache to persist through inserts, and subsequent appends will be much faster.

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

P3 – I'm not really blocked by it; it's an idea I'm proposing based on principle

Metadata

Metadata

Assignees

Labels

area/circuitsarea/performancegood first issueThis issue can be resolved by someone who is not familiar with the codebase. A good starting issue.kind/feature-requestDescribes new functionalitytriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked on

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions