Skip to content

Commit

Permalink
Repair codspeed benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Nov 12, 2024
1 parent e0e2717 commit 9e26d37
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
version: ${{ env.POETRY_VERSION }}

- name: Install build dependencies
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec pytest-codspeed
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec

# ta-lib Python install currently broken
# https://github.com/TA-Lib/ta-lib-python/issues/655
Expand Down
48 changes: 45 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ pytest = "^7.4.4"
pytest-aiohttp = "^1.0.5"
pytest-asyncio = "==0.21.1" # Pinned due Cython: cannot set '__pytest_asyncio_scoped_event_loop' attribute of immutable type
pytest-benchmark = "^4.0.0"
pytest-codspeed = "^3.0.0"
pytest-cov = "^4.1.0"
pytest-mock = "^3.14.0"
pytest-xdist = {version = "^3.6.1", extras = ["psutil"]}
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-performance.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

poetry run pytest tests/performance_tests --benchmark-disable-gc
poetry run pytest tests/performance_tests --benchmark-disable-gc --codspeed
2 changes: 2 additions & 0 deletions tests/performance_tests/test_perf_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from datetime import timedelta

import pandas as pd
import pytest

from nautilus_trader.common.component import LiveClock
from nautilus_trader.common.component import TestClock
Expand Down Expand Up @@ -46,6 +47,7 @@ def test_live_clock_timestamp_ms(benchmark) -> None:
benchmark(_LIVE_CLOCK.timestamp_ms)


@pytest.mark.skip()
def test_live_clock_cancel(benchmark) -> None:
def _start_and_cancel():
_LIVE_CLOCK.set_timer("timer1", pd.Timedelta(microseconds=10), callback=print)
Expand Down
2 changes: 2 additions & 0 deletions tests/performance_tests/test_perf_throttler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# -------------------------------------------------------------------------------------------------

import pandas as pd
import pytest

from nautilus_trader.common.component import LiveClock
from nautilus_trader.common.component import Throttler
Expand All @@ -31,6 +32,7 @@ def buffering_throttler(name: str, limit: int) -> Throttler:
)


@pytest.mark.skip()
def test_send_unlimited(benchmark):
throttler = buffering_throttler("buffer-1", 10_000)
benchmark(throttler.send, "MESSAGE")

0 comments on commit 9e26d37

Please sign in to comment.