From 4a63815f95b27efbc41b56e8598ab55fa61130b5 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 23 Feb 2023 13:51:08 +0000 Subject: [PATCH 1/4] Added configuration for asv --- asv.conf.json | 14 ++++++++++++++ benchmarks/benchmarks.py | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 asv.conf.json create mode 100644 benchmarks/benchmarks.py diff --git a/asv.conf.json b/asv.conf.json new file mode 100644 index 0000000..4a63297 --- /dev/null +++ b/asv.conf.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "project": "astropy", + "project_url": "http://astropy.org/", + "repo": "https://github.com/Cadair/astropy.git", + "branches": ["performance_issues_decompress_tile"], + "environment_type": "virtualenv", + "show_commit_url": "https://github.com/Cadair/astropy/commit/", + "pythons": ["3.11"], + "build_command": [ + "python -m pip install build", + "python -m build --wheel -o {build_cache_dir} {build_dir}", + ] +} diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py new file mode 100644 index 0000000..96c06d7 --- /dev/null +++ b/benchmarks/benchmarks.py @@ -0,0 +1,16 @@ +import os +from astropy.io import fits + +AIA_DATA = os.path.join(os.path.dirname(__file__), 'data', 'aia_lev1_193a_2013_03_15t12_01_06_84z_image_lev1.fits') + + +class TimeDataAccess: + """ + An example benchmark that times the performance of various kinds + of iterating over dictionaries in Python. + """ + def setup(self): + self.hdu = fits.open(AIA_DATA)[1] + + def time_access_data_aia(self): + self.hdu.data From 25e19232fea08e3adb90656922420a56f5e57ca2 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 23 Feb 2023 13:54:48 +0000 Subject: [PATCH 2/4] Add script to run asv --- run_asv.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 run_asv.sh diff --git a/run_asv.sh b/run_asv.sh new file mode 100755 index 0000000..eaa1e74 --- /dev/null +++ b/run_asv.sh @@ -0,0 +1,7 @@ +#!/bin/bash -xe + +# Last commit before FITS changes +asv run 9409d02ff9e101d4215f83aa1f9a23d805230fd0 + +# All commits since +asv run NEW From 45bf24acaf496408e16e04f24e0cb3580afe1376 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 23 Feb 2023 13:59:11 +0000 Subject: [PATCH 3/4] Fixes to script --- benchmarks/__init__.py | 0 benchmarks/benchmarks.py | 2 +- run_asv.sh | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 benchmarks/__init__.py diff --git a/benchmarks/__init__.py b/benchmarks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py index 96c06d7..e214fec 100644 --- a/benchmarks/benchmarks.py +++ b/benchmarks/benchmarks.py @@ -1,7 +1,7 @@ import os from astropy.io import fits -AIA_DATA = os.path.join(os.path.dirname(__file__), 'data', 'aia_lev1_193a_2013_03_15t12_01_06_84z_image_lev1.fits') +AIA_DATA = os.path.join(os.path.dirname(__file__), '..', 'data', 'aia_lev1_193a_2013_03_15t12_01_06_84z_image_lev1.fits') class TimeDataAccess: diff --git a/run_asv.sh b/run_asv.sh index eaa1e74..c3981cc 100755 --- a/run_asv.sh +++ b/run_asv.sh @@ -1,7 +1,7 @@ #!/bin/bash -xe # Last commit before FITS changes -asv run 9409d02ff9e101d4215f83aa1f9a23d805230fd0 +asv run -e 9409d02ff9e101d4215f83aa1f9a23d805230fd0^! # All commits since -asv run NEW +asv run -e NEW From ace8248ab0a9ea51e3819fd1f451a8b60dfca781 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 23 Feb 2023 14:02:03 +0000 Subject: [PATCH 4/4] Use taskset --- run_asv.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_asv.sh b/run_asv.sh index c3981cc..b05ec81 100755 --- a/run_asv.sh +++ b/run_asv.sh @@ -1,7 +1,7 @@ #!/bin/bash -xe # Last commit before FITS changes -asv run -e 9409d02ff9e101d4215f83aa1f9a23d805230fd0^! +taskset -c 0 asv run -e 9409d02ff9e101d4215f83aa1f9a23d805230fd0^! # All commits since -asv run -e NEW +taskset -c 0 asv run -e NEW