Skip to content

Conversation

@jesspav
Copy link
Collaborator

@jesspav jesspav commented Nov 12, 2025

Adds raster bench functionality and a first benchmark for the rs_width

Issue: #263

Sample run:

     Running benches/native-raster-functions.rs (target/release/deps/native_raster_functions-5e941e84741ac20f)
native-rs_width-Array(Raster(64, 64))
                        time:   [375.11 µs 375.71 µs 376.32 µs]
                        change: [-2.7842% -1.4353% +1.7299%] (p = 0.20 > 0.05)
                        No change in performance detected.

@jesspav jesspav changed the title Add Raster Benchmarking [WIP] Add Raster Benchmarking Nov 13, 2025
Kontinuation added a commit that referenced this pull request Nov 14, 2025
…g arrays from struct array (#306)

This optimization simply hoists per-column arrays in `RasterStructArray`, so that we don't need to extract individual arrays from the struct array each time we construct a `RasterRefImpl` value in `RasterStructArray::get`. We also marked short getters as inline so that the compiler could optimize away the construction of intermediate objects in simple metadata getter functions such as RS_Width.

I've benchmarked this using the `rs_width` bench in PR #297, the performance improvement is quite significant.

Baseline:

```
native-rs_width-Array(Raster(64, 64))
                        time:   [7.3810 ms 7.3912 ms 7.4034 ms]
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe
```

This PR:

```
native-rs_width-Array(Raster(64, 64))
                        time:   [474.81 µs 475.81 µs 476.75 µs]
                        change: [-93.593% -93.576% -93.560%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high severe
```
@jesspav jesspav changed the title [WIP] Add Raster Benchmarking Add Raster Benchmarking Nov 14, 2025
@jesspav jesspav requested a review from Copilot November 14, 2025 18:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds benchmarking infrastructure for raster functions, specifically implementing a benchmark for the rs_width function. The changes introduce a new Raster variant to the BenchmarkArgSpec enum to support generating raster data for benchmarks.

Key Changes:

  • Extended benchmark argument specifications to support raster data generation
  • Added infrastructure to create tiled rasters with configurable dimensions for benchmarking
  • Implemented a benchmark for the rs_width function using 64x64 rasters

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
rust/sedona-testing/src/benchmark_util.rs Added Raster variant to BenchmarkArgSpec enum with support for generating tiled rasters and corresponding test coverage
rust/sedona-raster-functions/benches/native-raster-functions.rs Created new benchmark file for raster functions, starting with rs_width
rust/sedona-raster-functions/Cargo.toml Added benchmark configuration with criterion dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jesspav jesspav marked this pull request as ready for review November 14, 2025 18:59
@jesspav jesspav requested a review from Kontinuation November 14, 2025 19:00
Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@paleolimbot paleolimbot changed the title Add Raster Benchmarking feat(rust/sedona-testing): Add Raster Benchmarking Nov 15, 2025
@paleolimbot paleolimbot merged commit 0c23df2 into apache:main Nov 15, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants