Qiskit / qiskit-ibm-runtime

IBM Client for Qiskit Runtime
https://docs.quantum.ibm.com/api/qiskit-ibm-runtime
Apache License 2.0
158 stars 156 forks source link

Speed up `QiskitRuntimeService.backends` #1889

Closed max-radin closed 3 weeks ago

max-radin commented 2 months ago

What is the expected feature or enhancement? I've found that if I have a QiskitRuntimeService object, the first call to the backends method often can take a really long time, sometimes around 60 seconds. I would expect this method to only take at most a few seconds.

Acceptance criteria Calls to QiskitRuntimeService.backends should take at most a few seconds.

kt474 commented 2 months ago

Following up on the slack conversation:

service.backends() gets the backend configuration of all backends you have access to which is why it takes a long time to load. After all the backend configurations are cached, then retrieving any single backend with backend() should be instant.
If the backends configurations are not cached, they are loaded lazily where calling backend() will just retrieve the configuration for a single backend.

service.backend() should only take a second or two after the service has already been initialized. Having said that we have noticed this taking upwards of 30 seconds so it's likely a server side issue. I follow up on their side.