-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve forecast etl performance #28
Conversation
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, probably worth a dev review too
f"single_level_{model_base_date_str}_{model_base_time}.grib", | ||
), | ||
( | ||
get_multi_level_request_body(model_base_date_str, model_base_time), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibility that creating new files each time this is run could cause issues for user of application?
Description
Performance was particularly slow because xarray lazily loads data from a dataset. We then try to access each dataset for each city which without eagerly loading is quite slow.
By explicitly calling load, we use more memory but performance improves. Introducing threads also significantly improves the runtime.
We now process all 153 in around 2 minutes instead of 10.
Default
15 cities per minutes
With eager load
25 cities per minute
With eager load and thread pool
76 cities per minute
Output