SciQLop / speasy

Space Physics made EASY! A simple Python package to deal with main Space Physics WebServices (CDA,SSC,AMDA,..)
Other
24 stars 7 forks source link

Loading speasy is slow #46

Closed Dolgalad closed 1 year ago

Dolgalad commented 2 years ago

Description

Loading speasy takes a couple seconds. Could we not store the inventory contents in the cache folder, accelerating the module initialization on subsequent imports. Perhaps we could start a detached process (in another thread) who's job would be to check all providers inventory and update the contents of the cache in a non-blocking way On average importing speasy takes 10 seconds on my machine.

What I Did

import time
t0 = time.time()
import speasy as spz
t0 = time.time() - t0
print(f"speasy loaded in {t0} seconds")

Output

speasy loaded in 10.583851099014282 seconds
Dolgalad commented 2 years ago

This is not an issue, sorry for the waste

jeandet commented 2 years ago

@Dolgalad In fact I think, we can keep it open, since:

I propose to build all inventories from speasy_proxy and distribute them with a new API endpoint.

jeandet commented 1 year ago

Slightly better with #49