client-superstaq icon indicating copy to clipboard operation
client-superstaq copied to clipboard

`provider.backends()` is too slow

Open richrines1 opened this issue 1 year ago • 2 comments

What is happening?

running provider.backends() is taking 45-60s to complete. About 15s of this is the time it takes to get the list of targets (and so this is about how long css.Service().get_targets() takes), The remaining 30s is just due to the calls to target_info for each backend

imo we should be returning more info from the get_targets endpoint to obviate the need for all the subsequent target_info calls, and anything not returned as part of get_targets should be lazily retrieved by backends if necessary

How can we reproduce the issue?

provider = qss.SuperstaqProvider()
service = css.Service()

t0 = time.time()
_ = provider.backends()
t1 = time.time()
_ = service.get_targets()
t2 = time.time()

print("provider.get_backends():", t1 - t0)
print("service.get_targets():", t2 - t1)

which just gave me

provider.get_backends(): 44.30445456504822
service.get_targets(): 14.650813341140747

What should happen?

provider.backends() shouldn't take much longer than service.get_targets(), or about 15s (ideally both should be faster)

Environment

  • Superstaq version: 0.4.37
  • client-superstaq version: 0.4.22

Any additional context?

No response

richrines1 avatar Sep 15 '23 06:09 richrines1