-
Notifications
You must be signed in to change notification settings - Fork 15
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
WIP Start adding some basic benchmarking infrastructure #372
Closed
Closed
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
593b672
Add very very basic benchmark test just to get things rolling
SolarDrew de7ef0b
Add tox env
SolarDrew dac0e20
Add benchmarks tox env to gh jobs list
SolarDrew a99d255
Move unzipping out of benchmark to just measure opening the asdf
SolarDrew bfc31c5
Pull benchmark data for latest release and compare
SolarDrew 76e4e92
Add tox env for benchmarking main and tweak not-main benchmark run
SolarDrew b6d0792
Add workflow to run benchmarks on main
SolarDrew 82332ea
Make file copying work in tox
SolarDrew 0d59140
Make github workflow push main benchmark results to repo
SolarDrew 2edc30d
Make some steps towards getting gh worklow working
SolarDrew 075e6de
Need to actually push changes for github workflow to see them
SolarDrew 3e3cafd
Make workflow push benchmark to repo
SolarDrew 234af5d
Make tox do it instead
SolarDrew 36bd260
Using different version of Python for workflow and local clearly a ba…
SolarDrew fe83f56
Committing needs user config
SolarDrew 31895ed
Need to know why push isn't working
SolarDrew 18700f2
Try disabling git terminal prompts
SolarDrew ddde74a
Well that hasn't helped, it just errors instead of hanging
SolarDrew 831c41d
Try doing the git bit in the workflow instead again
SolarDrew fae780a
Share volumes across docker images so we can commit results in the wo…
SolarDrew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import gzip | ||
from pathlib import Path | ||
|
||
from dkist import load_dataset | ||
from dkist.data.test import rootdir | ||
|
||
|
||
def load_asdf_from_gzip(tmp_path_factory): | ||
vispdir = tmp_path_factory.mktemp("data") | ||
with gzip.open(Path(rootdir) / "large_visp.asdf.gz", mode="rb") as gfo: | ||
with open(vispdir / "test_visp.asdf", mode="wb") as afo: | ||
afo.write(gfo.read()) | ||
ds = load_dataset(vispdir / "test_visp.asdf") | ||
|
||
|
||
def test_load_asdf(benchmark, tmp_path_factory): | ||
benchmark(load_asdf_from_gzip, tmp_path_factory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ envlist = | |
py310-oldestdeps | ||
build_docs{,-notebooks} | ||
codestyle | ||
benchmarks | ||
|
||
[testenv] | ||
pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt | ||
|
@@ -89,3 +90,8 @@ commands = | |
!notebooks: sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html -D nb_execution_mode=off {posargs} | ||
notebooks: sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} | ||
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))' | ||
|
||
[testenv:benchmarks] | ||
description = Run benchmarks against latest release to ensure there are no performance regressions | ||
commands = | ||
{env:PYTEST_COMMAND} -k test_benchmarks --benchmark-autosave --benchmark-compare=0001 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I propose that instead of |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
presumeably we would want this bit to be in a fixture so it's not part of the code getting benchmarked?