sot / chandra_aca

Chandra Aspect Camera Tools
https://sot.github.io/chandra_aca
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Improve caching performance by adjusting default call pattern (take 2) #154

Closed javierggt closed 1 year ago

javierggt commented 1 year ago

Description

This improved on #153 by setting model=conf.default_model when calling _get_grid_func_model whenever model is None

Interface impacts

Testing

Unit tests

Independent check of unit tests by [REVIEWER NAME]

Functional tests

Same as in #153, but fixing the last call:

In [1]: from chandra_aca import star_probs

In [2]: %time model = star_probs.get_grid_func_model()
CPU times: user 17.9 ms, sys: 2.05 ms, total: 19.9 ms
Wall time: 280 ms

In [3]: %time model = star_probs.get_grid_func_model(None)
CPU times: user 59 µs, sys: 0 ns, total: 59 µs
Wall time: 66.3 µs

In [4]: %time model = star_probs.get_grid_func_model("grid-*")
CPU times: user 21 µs, sys: 3 µs, total: 24 µs
Wall time: 29.6 µs
jeanconn commented 1 year ago

Might as well rebase if the other was merged though, right?