Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@ tests/.hypothesis

zarr/version.py
zarr.egg-info/

# air speed velocity benchmarking
/.asv/
90 changes: 90 additions & 0 deletions asv.conf.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
// The version of the config file format. Do not change, unless
// you know what you are doing.
"version": 1,

// The name of the project being benchmarked
"project": "zarr",

// The project's homepage
"project_url": "https://zarr.readthedocs.io/",

// The URL or local path of the source code repository for the
// project being benchmarked
"repo": ".",

// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "tip" (for mercurial).
"branches": ["HEAD"],

"build_command": [
"python -m build --wheel -o {build_cache_dir} {build_dir}"
],

// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
"dvcs": "git",

// The tool to use to create environments. May be "conda",
// "virtualenv" or other value depending on the plugins in use.
// If missing or the empty string, the tool will be automatically
// determined by looking for tools on the PATH environment
// variable.
"environment_type": "virtualenv",

// the base URL to show a commit for the project.
"show_commit_url": "https://github.com/zarr-developers/zarr-python/commit/",

// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
// "pythons": ["3.9"],

// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
// list indicates to just test against the default (latest)
// version.
"matrix": {
"build": [],
"packaging": []
},

// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
"benchmark_dir": "benchmarks",

// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
"env_dir": ".asv/env",


// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": ".asv/results",

// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
"html_dir": ".asv/html",

// The number of characters to retain in the commit hashes.
// "hash_length": 8,

// `asv` will cache wheels of the recent builds in each
// environment, making them faster to install next time. This is
// number of builds to keep, per environment.
"build_cache_size": 8,

// The commits after which the regression search in `asv publish`
// should start looking for regressions. Dictionary whose keys are
// regexps matching to benchmark names, and values corresponding to
// the commit (exclusive) after which to start looking for
// regressions. The default is to start from the first commit
// with results. If the commit is `null`, regression detection is
// skipped for the matching benchmark.
//
// "regressions_first_commits": {
// "some_benchmark": "352cdf", // Consider regressions only after this commit
// "another_benchmark": null, // Skip regression detection altogether
// }
}
46 changes: 0 additions & 46 deletions bench/compress_normal.py

This file was deleted.

160 changes: 0 additions & 160 deletions bench/compress_normal.txt

This file was deleted.

Empty file added benchmarks/__init__.py
Empty file.
28 changes: 28 additions & 0 deletions benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import zarr


class OneDIndexingSuite:
def time_1d_fill_no_sharding_no_compression(self) -> None:
array = zarr.create_array(
store={},
shape=(1000000,),
dtype="i4",
compressors=None,
filters=None,
chunks=(10000,),
fill_value=0,
)
array[:] = 1

def time_1d_fill_sharding_no_compression(self) -> None:
array = zarr.create_array(
store={},
shape=(1000000,),
dtype="i4",
compressors=None,
filters=None,
chunks=(10000,),
shards=(50000,),
fill_value=0,
)
array[:] = 1
1 change: 1 addition & 0 deletions changes/3554.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set up benchmarking via [air speed velocity](https://github.com/airspeed-velocity/asv).
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ docs = [
'astroid<4',
'pytest'
]

benchmark = ["asv>=0.6.5"]
[project.scripts]
zarr = "zarr._cli.cli:app"

Expand Down Expand Up @@ -270,6 +270,12 @@ dependencies = [
test = "pytest tests/test_docs.py -v"
list-env = "pip list"

[tool.hatch.envs.benchmark]
features = ["benchmark"]

[tool.hatch.envs.benchmark.scripts]
run = "asv run --dry-run --show-stderr"

[tool.ruff]
line-length = 100
force-exclude = true
Expand Down