diff --git a/.github/workflows/codspeed-matrix.sh b/.github/workflows/codspeed-matrix.sh new file mode 100755 index 000000000000..bfc72db98788 --- /dev/null +++ b/.github/workflows/codspeed-matrix.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate the CodSpeed benchmark matrix. +# +# Emits to stdout a compact JSON array of {"crate","bench"} objects — one per +# `[[bench]]` target in the selected workspace crates. Each object becomes one +# CodSpeed shard (`cargo codspeed run -p --bench `). Sharding +# one job per bench target keeps every shard under CodSpeed's hard per-upload +# limit of 1000 benchmarks, on the assumption that no single bench target +# defines >1000 benchmark cases. If a target ever crosses that line, split the +# bench source rather than reworking the sharding here. +# +# Targets are discovered structurally via `cargo metadata` (no Cargo.toml text +# parsing, no hardcoded crate list), so new crates and new `[[bench]]` targets +# are picked up automatically. +# +# A bench target is dropped from the matrix when its crate's Cargo.toml marks +# it skipped: +# +# [package.metadata.codspeed.benches] +# merge_kernels = { skip = true } # broken at runtime, fix and remove +# +# cargo surfaces that table at .packages[].metadata.codspeed.benches, so the +# skip list lives next to the bench in the crate that owns it. +# +# Usage: +# codspeed-matrix.sh # every workspace crate +# codspeed-matrix.sh arrow parquet # only the named crates (must be members) + +set -euo pipefail + +metadata="$(cargo metadata --format-version 1 --no-deps)" + +# Reject explicitly-requested crates that are not workspace members, so a typo +# in a `bench:` label fails loudly instead of silently benching nothing. +if [ "$#" -gt 0 ]; then + members="$(jq -r '.packages[].name' <<<"$metadata")" + for crate in "$@"; do + if ! grep -qxF "$crate" <<<"$members"; then + echo "::error::Unknown workspace crate '$crate'" >&2 + exit 1 + fi + done +fi + +selected="$(printf '%s\n' "$@" | jq -Rsc 'split("\n") | map(select(length > 0))')" + +jq -c \ + --argjson selected "$selected" ' + [ .packages[] + | .name as $crate + | (.metadata.codspeed.benches // {}) as $cfg + | select(($selected | length) == 0 or ($selected | index($crate))) + | .targets[] + | select(.kind | index("bench")) + | select(($cfg[.name].skip // false) | not) + | { crate: $crate, bench: .name } + ] +' <<<"$metadata" diff --git a/.github/workflows/codspeed-pr.yml b/.github/workflows/codspeed-pr.yml new file mode 100644 index 000000000000..80b6905dd552 --- /dev/null +++ b/.github/workflows/codspeed-pr.yml @@ -0,0 +1,179 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Opt-in CodSpeed benchmarking for pull requests, gated by labels and +# sharded one job per `[[bench]]` target in each selected crate. +# +# Label convention (managed manually on each PR): +# +# bench:all # every [[bench]] in the workspace +# bench: # every [[bench]] in that crate +# bench: bench: # union +# +# Where is a workspace member name, e.g. `bench:arrow`, +# `bench:parquet`, `bench:arrow-cast`. `bench:all` short-circuits and +# supersedes any per-crate labels. +# +# Topology mirrors codspeed.yml (setup + build run in parallel; bench +# is a matrix that downloads the build artifact and runs one bench +# target per shard). The `setup` job additionally filters the matrix +# by labels. +# +# Authorization: only users with write access to the repo can add +# labels, so the label is itself the authorization gate. +# +# Baseline: native `pull_request` event → CodSpeed compares against +# the base branch's latest CodSpeed report automatically. +# +# Fork PR caveat: workflows triggered by `pull_request` from fork PRs +# do not get an OIDC token. For benches on fork PRs, push the branch +# to this repo and label it there. + +name: codspeed-pr + +on: + pull_request: + types: [labeled, synchronize, opened, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + contents: read + id-token: write + pull-requests: write + +env: + CODSPEED_FEATURES: arrow/test_utils,arrow/csv,arrow/json,arrow/chrono-tz,arrow/prettyprint,arrow-schema/ffi,parquet/arrow,parquet/async,parquet/test_common,parquet/experimental,parquet/object_store + +jobs: + setup: + # Run only if at least one `bench:*` label is currently attached. + # The toJSON serialization wraps each label name in double quotes, + # so searching for `"bench:` matches only at the start of a label + # name. + if: contains(toJSON(github.event.pull_request.labels.*.name), '"bench:') + name: Generate bench matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.gen.outputs.matrix }} + scope: ${{ steps.gen.outputs.scope }} + steps: + - uses: actions/checkout@v6 + + - name: Resolve crates from labels and emit per-bench-target matrix + id: gen + env: + LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }} + # Discovery + the known-broken exclusion list live in the shared + # codspeed-matrix.sh (also used by codspeed.yml). `bench:all` passes + # no crate args (every crate); otherwise each `bench:` suffix + # is forwarded as an arg and validated against the workspace members + # by the script. + run: | + suffixes="$(jq -r '.[] | select(startswith("bench:")) | sub("^bench:"; "")' <<<"$LABELS")" + + if grep -qx "all" <<<"$suffixes"; then + scope="full workspace (bench:all)" + matrix="$(bash .github/workflows/codspeed-matrix.sh)" + else + scope="$(echo $suffixes | tr '\n' ' ')" + # Intentionally unquoted: each whitespace-separated suffix is a + # separate crate argument. + matrix="$(bash .github/workflows/codspeed-matrix.sh $suffixes)" + fi + + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" + echo "scope=$scope" >> "$GITHUB_OUTPUT" + echo "::notice::Scope: $scope ($(jq length <<<"$matrix") bench shards, known-broken targets excluded)" + + build: + # Gate on the same label condition as setup so we don't build when + # there are no benches to run. + if: contains(toJSON(github.event.pull_request.labels.*.name), '"bench:') + name: Build workspace benchmarks + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v6 + with: + submodules: true + + - name: Install protoc + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + + - name: Setup Rust toolchain, cache and cargo-codspeed + uses: moonrepo/setup-rust@v1 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + + - name: Build benchmarks + run: cargo codspeed build --workspace --features "$CODSPEED_FEATURES" + + - name: Pack bench binaries into a tarball + # actions/upload-artifact does not preserve Unix executable + # bits, so bench binaries downloaded by shards would otherwise + # land as 644 and fail with EACCES under `cargo codspeed run`. + run: tar -cf codspeed-binaries.tar -C target codspeed + + - name: Upload built bench binaries + uses: actions/upload-artifact@v4 + with: + name: codspeed-binaries + path: codspeed-binaries.tar + retention-days: 1 + if-no-files-found: error + + bench: + needs: [setup, build] + name: ${{ matrix.config.crate }} / ${{ matrix.config.bench }} + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.matrix) }} + steps: + - uses: actions/checkout@v6 + with: + submodules: true + + - name: Install cargo-codspeed + uses: moonrepo/setup-rust@v1 + with: + channel: stable + bins: cargo-codspeed + + - name: Download built bench binaries + uses: actions/download-artifact@v4 + with: + name: codspeed-binaries + path: . + + - name: Unpack bench binaries (preserves executable bits) + run: | + mkdir -p target + tar -xf codspeed-binaries.tar -C target + + - name: Run single bench target + uses: CodSpeedHQ/action@v4 + with: + mode: simulation + run: cargo codspeed run -p ${{ matrix.config.crate }} --bench ${{ matrix.config.bench }} diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml new file mode 100644 index 000000000000..00e81e1145e2 --- /dev/null +++ b/.github/workflows/codspeed.yml @@ -0,0 +1,163 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Continuous benchmarking on CodSpeed. +# +# Runs the full workspace bench suite on every push to main, sharded +# one job per `[[bench]]` target. Sharding at this granularity is +# required because both crate-level shards (e.g. parquet alone has 16 +# bench targets producing >1000 benchmarks) and the workspace as a +# whole exceed CodSpeed's 1000-benchmark per-upload limit. Jobs in the +# same workflow are auto-aggregated by CodSpeed into one report. +# https://codspeed.io/docs/features/sharded-benchmarks +# +# Topology: +# +# setup ─┐ +# ├──→ bench (matrix, ~78 jobs) +# build ─┘ +# +# `setup` discovers every `[[bench]]` target via `cargo metadata` (see +# codspeed-matrix.sh) and emits a {crate, bench} matrix. `build` does the +# full-workspace +# `cargo codspeed build` exactly once and uploads +# `target/codspeed//` as an artifact. `bench` shards download the +# artifact and run a single bench target each via the CodSpeed action; +# no rebuild per shard. +# +# Auth is via GitHub OIDC; the workflow's `id-token` claim is what +# CodSpeed verifies, so no secret token is required. +# +# The `criterion` workspace dependency is renamed to +# `codspeed-criterion-compat`, so existing `use criterion::*` benches +# work unmodified; outside of CodSpeed the compat layer falls back to +# standard criterion behavior. + +name: codspeed + +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.sha }} + cancel-in-progress: false + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + id-token: write + +env: + CODSPEED_FEATURES: arrow/test_utils,arrow/csv,arrow/json,arrow/chrono-tz,arrow/prettyprint,arrow-schema/ffi,parquet/arrow,parquet/async,parquet/test_common,parquet/experimental,parquet/object_store + +jobs: + setup: + name: Generate bench matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.gen.outputs.matrix }} + steps: + - uses: actions/checkout@v6 + + - name: Generate {crate, bench} matrix across the workspace + id: gen + # Discovery + the known-broken exclusion list live in the shared + # codspeed-matrix.sh (also used by codspeed-pr.yml) so they stay in + # one place. No args = every workspace crate. + run: | + matrix="$(bash .github/workflows/codspeed-matrix.sh)" + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" + echo "::notice::Generated $(jq length <<<"$matrix") bench shards (one per bench target, known-broken targets excluded)" + + build: + name: Build workspace benchmarks + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v6 + with: + submodules: true + + - name: Install protoc + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + + - name: Setup Rust toolchain, cache and cargo-codspeed + uses: moonrepo/setup-rust@v1 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + + - name: Build benchmarks + # The --features list enables every feature any workspace bench + # target gates behind `required-features`; without these those + # benches silently aren't built. + run: cargo codspeed build --workspace --features "$CODSPEED_FEATURES" + + - name: Pack bench binaries into a tarball + # actions/upload-artifact does not preserve Unix executable + # bits, so downloaded bench binaries land as 644 and + # `cargo codspeed run` then fails with EACCES. Tar preserves + # mode bits, so we wrap the directory before upload. + run: tar -cf codspeed-binaries.tar -C target codspeed + + - name: Upload built bench binaries + uses: actions/upload-artifact@v4 + with: + name: codspeed-binaries + path: codspeed-binaries.tar + retention-days: 1 + if-no-files-found: error + + bench: + needs: [setup, build] + name: ${{ matrix.config.crate }} / ${{ matrix.config.bench }} + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.matrix) }} + steps: + - uses: actions/checkout@v6 + with: + submodules: true + + - name: Install cargo-codspeed + uses: moonrepo/setup-rust@v1 + with: + channel: stable + bins: cargo-codspeed + + - name: Download built bench binaries + uses: actions/download-artifact@v4 + with: + name: codspeed-binaries + path: . + + - name: Unpack bench binaries (preserves executable bits) + run: | + mkdir -p target + tar -xf codspeed-binaries.tar -C target + + - name: Run single bench target + uses: CodSpeedHQ/action@v4 + with: + mode: simulation + run: cargo codspeed run -p ${{ matrix.config.crate }} --bench ${{ matrix.config.bench }} diff --git a/Cargo.lock b/Cargo.lock index 28fe6a43a5c5..499fa306ba65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,15 +46,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "alloca" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4" -dependencies = [ - "cc", -] - [[package]] name = "android_system_properties" version = "0.1.5" @@ -106,7 +97,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -117,7 +108,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -188,7 +179,7 @@ dependencies = [ "arrow-string", "bytes", "chrono", - "criterion", + "codspeed-criterion-compat", "half", "memmap2", "rand 0.9.4", @@ -217,7 +208,7 @@ dependencies = [ "arrow-schema", "chrono", "chrono-tz", - "criterion", + "codspeed-criterion-compat", "futures", "half", "hashbrown 0.17.0", @@ -241,8 +232,8 @@ dependencies = [ "async-stream", "bytes", "bzip2", + "codspeed-criterion-compat", "crc", - "criterion", "flate2", "futures", "half", @@ -269,7 +260,7 @@ name = "arrow-buffer" version = "58.3.0" dependencies = [ "bytes", - "criterion", + "codspeed-criterion-compat", "half", "num-bigint", "num-traits", @@ -289,8 +280,8 @@ dependencies = [ "atoi", "base64", "chrono", + "codspeed-criterion-compat", "comfy-table", - "criterion", "half", "insta", "lexical-core", @@ -410,7 +401,7 @@ dependencies = [ "arrow-schema", "arrow-select", "bytes", - "criterion", + "codspeed-criterion-compat", "flatbuffers", "lz4_flex", "memmap2", @@ -432,7 +423,7 @@ dependencies = [ "arrow-select", "bytes", "chrono", - "criterion", + "codspeed-criterion-compat", "flate2", "futures", "half", @@ -493,7 +484,7 @@ name = "arrow-schema" version = "58.3.0" dependencies = [ "bitflags", - "criterion", + "codspeed-criterion-compat", "insta", "postcard", "serde", @@ -940,12 +931,80 @@ dependencies = [ "thiserror 2.0.18", ] +[[package]] +name = "codspeed" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7ce4a32373a5c84f4fa785099b300b9b1796311abc122b9eb62c65fa615145d" +dependencies = [ + "anyhow", + "cc", + "colored", + "getrandom 0.2.17", + "glob", + "libc", + "nix", + "serde", + "serde_json", + "statrs", +] + +[[package]] +name = "codspeed-criterion-compat" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5557c4e023f427ba208b849193c51c2ebd40534828490cd3f5f7f7fc0284ce5" +dependencies = [ + "clap", + "codspeed", + "codspeed-criterion-compat-walltime", + "colored", + "futures", + "regex", +] + +[[package]] +name = "codspeed-criterion-compat-walltime" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43ac19f0a5c3542301e9d011d658f93c3f550698ec8ba7d7c072692e7924c401" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "codspeed", + "criterion-plot", + "futures", + "is-terminal", + "itertools 0.10.5", + "num-traits", + "once_cell", + "oorandom", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + [[package]] name = "colorchoice" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" +[[package]] +name = "colored" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" +dependencies = [ + "lazy_static", + "windows-sys 0.52.0", +] + [[package]] name = "comfy-table" version = "7.2.2" @@ -1042,38 +1101,14 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "criterion" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3" -dependencies = [ - "alloca", - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "futures", - "itertools 0.13.0", - "num-traits", - "oorandom", - "page_size", - "regex", - "serde", - "serde_json", - "tinytemplate", - "walkdir", -] - [[package]] name = "criterion-plot" -version = "0.8.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools 0.13.0", + "itertools 0.10.5", ] [[package]] @@ -1248,7 +1283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1484,6 +1519,12 @@ dependencies = [ "wasip3", ] +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + [[package]] name = "h2" version = "0.4.14" @@ -1538,6 +1579,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + [[package]] name = "hex" version = "0.4.3" @@ -1847,6 +1894,17 @@ version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -1855,9 +1913,9 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" -version = "0.13.0" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -2117,6 +2175,18 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" +[[package]] +name = "nix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "ntapi" version = "0.4.3" @@ -2132,7 +2202,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2277,16 +2347,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" -[[package]] -name = "page_size" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "parking_lot" version = "0.12.5" @@ -2329,8 +2389,8 @@ dependencies = [ "bytes", "chrono", "clap", + "codspeed-criterion-compat", "crc32fast", - "criterion", "flate2", "futures", "half", @@ -2379,7 +2439,7 @@ dependencies = [ "arrow", "arrow-schema", "chrono", - "criterion", + "codspeed-criterion-compat", "half", "indexmap", "num-traits", @@ -2396,7 +2456,7 @@ dependencies = [ "arrow", "arrow-schema", "chrono", - "criterion", + "codspeed-criterion-compat", "half", "indexmap", "parquet-variant", @@ -2958,7 +3018,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3222,7 +3282,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3231,6 +3291,16 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "statrs" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a3fe7c28c6512e766b0874335db33c94ad7b8f9054228ae1c2abd47ce7d335e" +dependencies = [ + "approx", + "num-traits", +] + [[package]] name = "strsim" version = "0.11.1" @@ -3331,10 +3401,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3344,7 +3414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4018,7 +4088,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 9a13149626e9..b11a405d7d4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,7 +108,7 @@ parquet-variant-compute = { version = "58.3.0", path = "./parquet-variant-comput chrono = { version = "0.4.40", default-features = false, features = ["clock"] } -criterion = { version = "0.8.0", default-features = false } +criterion = { package = "codspeed-criterion-compat", version = "4.6", default-features = false } insta = { version = "1.46.3", default-features = false } diff --git a/README.md b/README.md index 7ea4205d56f5..a51477eca363 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ # Native Rust implementation of Apache Arrow and Apache Parquet +[![CodSpeed](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/apache/arrow-rs?utm_source=badge) + Welcome to the [Rust][rust] implementation of [Apache Arrow], a popular in-memory columnar format and [Apache Parquet], a popular columnar file format. diff --git a/arrow-array/Cargo.toml b/arrow-array/Cargo.toml index df102c32b0d0..cbe21350b33d 100644 --- a/arrow-array/Cargo.toml +++ b/arrow-array/Cargo.toml @@ -61,6 +61,11 @@ hashbrown = { version = "0.17.0", default-features = false } [package.metadata.docs.rs] all-features = true +[package.metadata.codspeed.benches] +# Skipped on CodSpeed (read by .github/workflows/codspeed-matrix.sh): +# currently fails at runtime. Fix the bench and remove this entry. +union_array = { skip = true } + [features] async = ["dep:futures"] ffi = ["arrow-schema/ffi", "arrow-data/ffi"] diff --git a/arrow-cast/Cargo.toml b/arrow-cast/Cargo.toml index 81649353d182..d3c9334f3135 100644 --- a/arrow-cast/Cargo.toml +++ b/arrow-cast/Cargo.toml @@ -35,6 +35,11 @@ bench = false [package.metadata.docs.rs] all-features = true +[package.metadata.codspeed.benches] +# Skipped on CodSpeed (read by .github/workflows/codspeed-matrix.sh): +# currently fails at runtime. Fix the bench and remove this entry. +parse_date = { skip = true } + [features] prettyprint = ["comfy-table"] force_validate = [] diff --git a/arrow/Cargo.toml b/arrow/Cargo.toml index 8e56457ff0a5..b059afb628c7 100644 --- a/arrow/Cargo.toml +++ b/arrow/Cargo.toml @@ -60,6 +60,19 @@ half = { version = "2.1", default-features = false, features = ["rand_distr"], o [package.metadata.docs.rs] all-features = true +[package.metadata.codspeed.benches] +# Per-bench CodSpeed config, read by .github/workflows/codspeed-matrix.sh. +# `skip = true` drops the bench target from the CodSpeed matrix; these +# currently panic/error at runtime, so fix the bench and remove its entry, +# one at a time. (A per-bench `mode = "simulation" | "walltime"` could live +# here too, once the workflow builds both measurement modes.) +merge_kernels = { skip = true } +buffer_bit_ops = { skip = true } +buffer_create = { skip = true } +sort_kernel = { skip = true } +string_run_builder = { skip = true } +primitive_run_accessor = { skip = true } + [features] default = ["csv", "ipc", "json"] async = ["arrow-array/async"] diff --git a/parquet-variant-compute/Cargo.toml b/parquet-variant-compute/Cargo.toml index bcfb36b8710c..39a1403522cd 100644 --- a/parquet-variant-compute/Cargo.toml +++ b/parquet-variant-compute/Cargo.toml @@ -27,6 +27,11 @@ keywords = ["arrow", "parquet", "variant"] edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.codspeed.benches] +# Skipped on CodSpeed (read by .github/workflows/codspeed-matrix.sh): +# intermittently fails at runtime. Fix the bench and remove this entry. +variant_kernels = { skip = true } + [dependencies] arrow = { workspace = true, features = ["canonical_extension_types"] } arrow-schema = { workspace = true } diff --git a/parquet/Cargo.toml b/parquet/Cargo.toml index dd2c872ede50..4cee7cbd07b6 100644 --- a/parquet/Cargo.toml +++ b/parquet/Cargo.toml @@ -98,6 +98,11 @@ sysinfo = { version = "0.38.1", default-features = false, features = ["system"] [package.metadata.docs.rs] all-features = true +[package.metadata.codspeed.benches] +# Skipped on CodSpeed (read by .github/workflows/codspeed-matrix.sh): +# currently fails at runtime. Fix the bench and remove this entry. +row_selection_cursor = { skip = true } + [features] default = ["arrow", "snap", "brotli", "flate2-zlib-rs", "lz4", "zstd", "base64", "simdutf8"] # Enable lz4