Skip to content
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

Performance improvement kadi states #266

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Performance improvement kadi states #266

merged 1 commit into from
Nov 20, 2023

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Jan 2, 2023

Description

This is part of the Performance project. It speeds up get_states by a factor of 2 to 3.

Interface impacts

None

Testing

Unit tests

  • Mac

Independent check of unit tests by Jean

  • Linux

Functional tests

Test script

import time

import kadi
from kadi.commands import get_cmds
from kadi.commands.states import get_states

print(f"{kadi.__version__=}")

start, stop = "2021:001", "2022:001"
cmds = get_cmds(start, stop, scenario="flight")

t0 = time.time()
states = get_states(start, stop)
print(f"get_states took {time.time() - t0:.1f} sec")

t0 = time.time()
states = get_states(start, stop)
print(f"2nd get_states took {time.time() - t0:.1f} sec")

Results on older Intel Mac with WIP versions

Flight

kadi.__version__='7.0.2'
get_states took 18.5 sec
2nd get_states took 18.1 sec

PR 266

kadi.__version__='7.1.1.dev68+ge0dd365'
get_states took 5.5 sec
2nd get_states took 4.8 sec

Results with newer M2 Mac (emulation)

Flight

(ska3) ➜  validate git:(performance) python performance_states.py
kadi.__version__='7.6.0'
get_states took 6.0 sec
2nd get_states took 5.6 sec

Dev

Versions:

$ conda list | grep pypi | grep \.dev
chandra-aca               4.42.1.dev13+gcf5cbc1          pypi_0    pypi
chandra-maneuver          4.0.1.dev8+g3e2cc1c          pypi_0    pypi
cxotime                   3.6.2.dev1+g47d1e30          pypi_0    pypi
kadi                      7.6.1.dev19+g4e92cf7          pypi_0    pypi
quaternion                4.1.2.dev10+g4795e33          pypi_0    pypi
ska-helpers               0.12.1.dev2+gbee8099          pypi_0    pypi
ska-sun                   3.10.2.dev13+gc811fa4          pypi_0    pypi
(ska3-perf) ➜  validate git:(performance) python performance_states.py
kadi.__version__='7.6.1.dev19+g4e92cf7'
get_states took 2.7 sec
2nd get_states took 2.3 sec

@taldcroft taldcroft changed the title Performance improvement kadi states WIP Performance improvement kadi states Jan 2, 2023
@taldcroft taldcroft changed the title WIP Performance improvement kadi states Performance improvement kadi states Nov 11, 2023
@taldcroft taldcroft requested a review from jeanconn November 16, 2023 10:39
@jeanconn
Copy link
Contributor

For this, tests aren't passing for me on kady with ska3-masters against this PR or against kadi in master, so I don't have passing tests available to sign off.

@jeanconn
Copy link
Contributor

With sot/cxotime#42 and https://github.com/sot/chandra_maneuver/pull/26 tests are now passing in for this PR (and master).

@taldcroft taldcroft merged commit 035ad40 into master Nov 20, 2023
4 checks passed
@taldcroft taldcroft deleted the performance branch November 20, 2023 16:33
@javierggt javierggt mentioned this pull request Dec 5, 2023
@javierggt javierggt mentioned this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants