Skip to content

Commit 9a482c0

Browse files
authored
Add scalar function performance baselines (#9136)
## Summary Tracking Issue: #9128 Adds stable scalar function performance baselines for `byte_length`, `l2_norm`, `normalized`, `inner_product`, `cosine_similarity`, `GeoContains`, and `GeoIntersects`. The benchmark sizes are all comfortably above the roughly 146-instruction Divan harness floor from #9011. Each benchmark binary also uses vendored `mimalloc`, since scalar function execution allocates its output inside the timed trace and glibc differences between runner images caused the flakes fixed in #8861. ## Why Codspeed can only compare a later implementation change when the same benchmark name already exists on `develop`, so these baselines need to land before the `RowFn` things I want to make. And these are pretty cheap, might as well add them. --------- Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1 parent 695e068 commit 9a482c0

13 files changed

Lines changed: 989 additions & 3 deletions

File tree

.github/workflows/codspeed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
- { shard: 6, name: "Encodings 3", packages: "vortex-pco vortex-runend vortex-sequence" }
5858
- { shard: 7, name: "Encodings 4", packages: "vortex-sparse vortex-zigzag vortex-zstd" }
5959
- { shard: 8, name: "Storage formats & row encoding", packages: "vortex-flatbuffers vortex-proto vortex-btrblocks vortex-row" }
60+
- { shard: 9, name: "Tensor & geo", packages: "vortex-tensor vortex-geo" }
6061
name: "Benchmark with Codspeed (Shard #${{ matrix.shard }})"
6162
timeout-minutes: 30
6263
runs-on: >-

Cargo.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vortex-array/benches/binary_ops.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn main() {
3636

3737
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);
3838

39-
const LEN: usize = 65_536;
39+
const LEN: usize = 32_768;
4040

4141
#[divan::bench]
4242
fn add_i64_nonnull(bencher: Bencher) {
@@ -54,6 +54,30 @@ fn add_i64_nullable(bencher: Bencher) {
5454
bench_primitive(bencher, lhs, rhs, Operator::Add);
5555
}
5656

57+
#[divan::bench]
58+
fn add_i64_constant(bencher: Bencher) {
59+
let lhs = primitive_nonnull(0).into_array();
60+
let rhs = ConstantArray::new(1_000_000i64, LEN).into_array();
61+
62+
bench_primitive(bencher, lhs, rhs, Operator::Add);
63+
}
64+
65+
#[divan::bench]
66+
fn add_i32_nonnull(bencher: Bencher) {
67+
let lhs = primitive_i32_small_nonnull(1).into_array();
68+
let rhs = primitive_i32_small_nonnull(17).into_array();
69+
70+
bench_primitive(bencher, lhs, rhs, Operator::Add);
71+
}
72+
73+
#[divan::bench]
74+
fn add_u32_nonnull(bencher: Bencher) {
75+
let lhs = primitive_u32_small_nonnull(1).into_array();
76+
let rhs = primitive_u32_small_nonnull(17).into_array();
77+
78+
bench_primitive(bencher, lhs, rhs, Operator::Add);
79+
}
80+
5781
#[divan::bench]
5882
fn mul_i64_nonnull(bencher: Bencher) {
5983
let lhs = primitive_small_nonnull(1).into_array();

vortex-geo/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ _test-harness = []
3636

3737
[dev-dependencies]
3838
divan = { workspace = true }
39+
mimalloc = { workspace = true }
3940
rstest = { workspace = true }
4041
vortex-array = { workspace = true, features = ["_test-harness"] }
4142
vortex-geo = { path = ".", features = ["_test-harness"] }
@@ -49,5 +50,13 @@ harness = false
4950
name = "predicate_bbox"
5051
harness = false
5152

53+
[[bench]]
54+
name = "binary_predicates"
55+
harness = false
56+
57+
[[bench]]
58+
name = "distance"
59+
harness = false
60+
5261
[lints]
5362
workspace = true

0 commit comments

Comments
 (0)