Skip to content

Commit 7de35ed

Browse files
committed
add benchmark
1 parent e231d65 commit 7de35ed

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,18 @@ jobs:
2929
cache-dependency-glob: pyproject.toml
3030
- run: uv pip install --system -e .[test${{ matrix.extras == 'full' && ',full' || '' }}]
3131
- run: |
32-
coverage run -m pytest
32+
coverage run -m pytest -m "not benchmark"
3333
coverage xml
3434
coverage report
3535
- uses: codecov/codecov-action@v5
3636
with:
3737
fail_ci_if_error: true
3838
files: test-data/coverage.xml
3939
token: ${{ secrets.CODECOV_TOKEN }}
40+
- uses: CodSpeedHQ/action@v3
41+
with:
42+
run: pytest -m benchmark --codspeed
43+
token: ${{ secrets.CODSPEED_TOKEN }}
4044
check:
4145
runs-on: ubuntu-latest
4246
strategy:

README.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|docs| |ci| |cov|
1+
|docs| |ci| |cov| |bench|
22

33
.. |docs| image:: https://readthedocs.com/projects/icb-fast-array-utils/badge/?version=latest
44
:target: https://icb-fast-array-utils.readthedocs-hosted.com/en/latest/
@@ -9,5 +9,8 @@
99
.. |cov| image:: https://codecov.io/gh/scverse/fast-array-utils/graph/badge.svg?token=CR62H2QRWY
1010
:target: https://codecov.io/gh/scverse/fast-array-utils
1111

12+
.. |bench| image:: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json
13+
:target: https://codspeed.io/scverse/fast-array-utils
14+
1215
fast-array-utils
1316
================

tests/test_sparse.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,8 @@ def test_to_dense(order: Literal["C", "F"], sp_mat: CSBase[np.float64]) -> None:
5555
assert arr.flags[order]
5656
assert arr.dtype == sp_mat.dtype
5757
np.testing.assert_equal(arr, sp_mat.toarray(order=order))
58+
59+
60+
@pytest.mark.benchmark
61+
def test_to_dense_benchmark(order: Literal["C", "F"], sp_mat: CSBase[np.float64]) -> None:
62+
to_dense(sp_mat, order=order)

0 commit comments

Comments
 (0)