Skip to content

refactor(rust): Remove recursion from upsample_impl #25948

refactor(rust): Remove recursion from upsample_impl

refactor(rust): Remove recursion from upsample_impl #25948

Workflow file for this run

name: Benchmark
on:
pull_request:
paths:
- crates/**
- Cargo.toml
- py-polars/tests/benchmark/**
- .github/workflows/benchmark.yml
push:
branches:
- main
paths:
- crates/**
- Cargo.toml
- py-polars/tests/benchmark/**
- .github/workflows/benchmark.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
SCCACHE_GHA_ENABLED: 'true'
RUSTC_WRAPPER: sccache
RUST_BACKTRACE: 1
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Set up Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Create virtual environment
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
- name: Install Python dependencies
working-directory: py-polars
run: |
# Install typing-extensions separately whilst the `--extra-index-url` in `requirements-ci.txt`
# doesn't have an up-to-date typing-extensions, see
# https://github.com/astral-sh/uv/issues/6028#issuecomment-2287232150
uv pip install -U typing-extensions
uv pip install --compile-bytecode -r requirements-dev.txt -r requirements-ci.txt --verbose --index-strategy=unsafe-best-match
- name: Set up Rust
run: rustup show
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: py-polars
save-if: ${{ github.ref_name == 'main' }}
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Build Polars release build
working-directory: py-polars
run: |
# Make sure we use the Polars we're about to build.
uv pip uninstall polars-runtime-32 polars-runtime-64 polars-runtime-compat
uv pip install --no-deps -e .
maturin build --manifest-path runtime/polars-runtime-32/Cargo.toml --profile nodebug-release -- -C codegen-units=8 -C lto=thin -C target-cpu=native
- name: Install Polars release build
run: |
pip install --force-reinstall target/wheels/polars*.whl
- name: Set wheel size
run: |
LIB_SIZE=$(ls -l target/wheels/polars*.whl | awk '{ print $5 }')
echo "LIB_SIZE=$LIB_SIZE" >> $GITHUB_ENV
- name: Comment wheel size
uses: actions/github-script@v8
if: github.ref_name != 'main'
with:
script: |
const currentSize = process.env.LIB_SIZE || 'Unknown';
// Convert to MB
const currentSizeMB = currentSize !== 'Unknown' ? (currentSize / 1024 / 1024).toFixed(4) : 'Unknown';
let commentBody = `The uncompressed lib size after this PR is **${currentSizeMB} MB**.`;
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
// Look for an existing comment
const existingComment = comments.find(comment =>
comment.body.includes('The previous uncompressed lib size was')
);
if (existingComment) {
// Update the existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body: commentBody,
});
} else {
// Create a new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: commentBody,
});
}
continue-on-error: true
# - name: Run benchmark tests
# uses: CodSpeedHQ/action@v3
# with:
# working-directory: py-polars
# run: pytest -m benchmark --codspeed -v
- name: Run non-benchmark tests
working-directory: py-polars
run: pytest -m 'not benchmark and not debug' -n auto
env:
POLARS_TIMEOUT_MS: 60000
- name: Run non-benchmark tests on new streaming engine
working-directory: py-polars
env:
POLARS_AUTO_NEW_STREAMING: 1
POLARS_TIMEOUT_MS: 60000
run: pytest -n auto -m "not may_fail_auto_streaming and not slow and not write_disk and not release and not docs and not hypothesis and not benchmark and not ci_only"