-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve_parameters
is slow for cirq.Duration
#6269
Comments
I tried the initial profiling on the two cases, the one with The one with
The one without
Looks like the problem is located under |
Resolve parameters is definitely slow, but in this case the problem seems to be with resolving |
@maffoo One easy fix for |
As suggested above, I've sent a fix to speedup the parameter resolution for On my machine, after this change, the original code snippet takes ~700ms, which is basically the same time it takes without the |
resolve_parameters
can be slowresolve_parameters
is slow for cirq.Duration
Description of the issue
It seems like by including just one extra parameter to resolve, the time it takes increases dramatically.
How to reproduce the issue
This takes ~14 seconds on my machine. However, if I exclude
wait_moment
from the circuit such that there is one less parameter, then it only takes ~2 seconds. Note that the length of the sweep is the same in both cases. I have attached cProfiles below in the details.Fast version
Slow version
Cirq version
'1.3.0.dev20230828214840'
The text was updated successfully, but these errors were encountered: