Skip to content
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

Test PGO on x86_64 ubuntu #21

Merged
merged 5 commits into from
Mar 9, 2024
Merged
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
31 changes: 28 additions & 3 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,40 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12" # use the latest version of Python because it is faster

- name: Install dependencies.
- name: Install python dependencies.
run: pip install ".[dev]"

- name: Install rust stable.
id: rust-toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools

- name: Cache rust.
uses: Swatinem/rust-cache@v2

- name: Compile.
run: pip install -v -e .
env:
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"

- name: Gather PGO data.
run: pytest . --benchmark-enable

- name: Prepare merged PGO data.
run: rustup run stable bash -c '$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata'

- name: Compile with profile.
run: pip install -v -e .
env:
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"

- name: Run benchmarks.
uses: CodSpeedHQ/action@v2
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: pytest . --codspeed
run: pytest . --codspeed -n auto
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ classifiers = [
"Author" = "https://github.com/MarshalX"

[project.optional-dependencies]
dev = ["pytest", "pytest-benchmark", "pytest-codspeed"]
dev = ["pytest==7.4.4", "pytest-benchmark==4.0.0", "pytest-codspeed==2.2.0", "pytest-xdist==3.5.0"]

[tool.pytest.ini_options]
addopts = [
Expand Down
Loading