-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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