Skip to content

Conversation

not-matthias
Copy link
Member

No description provided.

@not-matthias not-matthias force-pushed the cod-1374-codspeed-rust-add-perf-v2-support branch 2 times, most recently from 2d43c27 to 8a1f89e Compare September 23, 2025 13:48
Copy link

@Copilot 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 migrates CodSpeed's Rust integration from a FIFO-based communication system to a new C-based instrument hooks API for performance v2 support. The changes enable better benchmark instrumentation and timing measurement for performance analysis.

  • Replaces FIFO communication with instrument hooks FFI bindings
  • Adds support for benchmark timestamp collection and marker insertion
  • Updates benchmark examples to use the new codspeed_divan_compat API

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/divan_compat/divan_fork/src/divan.rs Updates benchmark URI reporting to use instrument hooks instead of FIFO
crates/divan_compat/divan_fork/src/bench/mod.rs Replaces FIFO guards with instrument hooks and adds timestamp collection
crates/codspeed/src/instrument_hooks/mod.rs New FFI wrapper for C instrument hooks library with Unix/non-Unix implementations
crates/codspeed/src/instrument_hooks/ffi.rs FFI bindings generated from C headers
crates/codspeed/build.rs Build script to compile C library and generate bindings
crates/codspeed/Cargo.toml Adds build dependencies for bindgen and cc
.gitmodules Adds instrument-hooks submodule
.github/workflows/ci.yml Updates CI configuration for new instrumentation mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@not-matthias not-matthias force-pushed the cod-1374-codspeed-rust-add-perf-v2-support branch from 8a1f89e to 4279028 Compare September 23, 2025 13:54
Copy link

@Copilot 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

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@not-matthias not-matthias force-pushed the cod-1374-codspeed-rust-add-perf-v2-support branch 2 times, most recently from 4adacd6 to 440c59f Compare September 23, 2025 14:27
Copy link

codspeed-hq bot commented Sep 23, 2025

CodSpeed Instrumentation Performance Report

Merging #121 will degrade performances by 23.49%

Comparing cod-1374-codspeed-rust-add-perf-v2-support (c9b70bf) with main (4be2e55)

Summary

⚡ 11 improvements
❌ 10 regressions
✅ 146 untouched
🆕 19 new

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
Iterative 132.5 ns 161.7 ns -18.04%
Iterative[20] 132.5 ns 161.7 ns -18.04%
Iterative[21] 134.2 ns 163.3 ns -17.86%
bench_array1[4] 183.6 ns 154.4 ns +18.88%
bench_array2[4] 183.6 ns 154.4 ns +18.88%
init_array[4] 183.6 ns 154.4 ns +18.88%
mut_borrow 895 ns 924.2 ns -3.16%
🆕 bench_large_input N/A 1.6 ms N/A
🆕 bench_large_input_local N/A 1.5 ms N/A
🆕 fib_10 N/A 859.7 ns N/A
🆕 fib_20 N/A 70 µs N/A
🆕 fib_30 N/A 8.6 ms N/A
🆕 sleep_100ms N/A 566.1 ns N/A
🆕 sleep_100ms_with_custom_sample N/A 566.1 ns N/A
🆕 sleep_10ms N/A 566.1 ns N/A
🆕 sleep_1ms N/A 566.1 ns N/A
🆕 sleep_50ms N/A 566.1 ns N/A
🆕 fib_in_thread[30] N/A 9.7 ms N/A
🆕 fib_in_thread[31] N/A 15.8 ms N/A
🆕 fib_in_thread[32] N/A 25.5 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@not-matthias not-matthias force-pushed the cod-1374-codspeed-rust-add-perf-v2-support branch 2 times, most recently from db66db2 to 9391337 Compare September 24, 2025 16:28
@codspeed-hq codspeed-hq bot deleted a comment from avalanche-staging bot Sep 24, 2025
@not-matthias not-matthias force-pushed the cod-1374-codspeed-rust-add-perf-v2-support branch from 9391337 to 088d32d Compare September 24, 2025 16:37
@codspeed-hq codspeed-hq bot deleted a comment from avalanche-staging bot Sep 24, 2025
@codspeed-hq codspeed-hq bot deleted a comment from avalanche-staging bot Sep 24, 2025
Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

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

looks good!

@not-matthias not-matthias force-pushed the cod-1374-codspeed-rust-add-perf-v2-support branch 3 times, most recently from 5bd327f to 6458923 Compare September 26, 2025 13:25
@codspeed-hq codspeed-hq bot deleted a comment from avalanche-staging bot Oct 1, 2025
@not-matthias not-matthias force-pushed the cod-1374-codspeed-rust-add-perf-v2-support branch from 4a691ee to c9b70bf Compare October 2, 2025 08:36
Copy link

codspeed-hq bot commented Oct 2, 2025

CodSpeed WallTime Performance Report

Merging #121 will degrade performances by 62.57%

Comparing cod-1374-codspeed-rust-add-perf-v2-support (c9b70bf) with main (4be2e55)

Summary

⚡ 10 improvements
❌ 53 regressions
✅ 91 untouched
🆕 14 new

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
build_vec 214 ns 224 ns -4.46%
Recursive 47.2 µs 52.3 µs -9.87%
Recursive[20] 47 µs 52.5 µs -10.48%
Recursive[21] 76.6 µs 85.6 µs -10.5%
fibonacci_custom_measurement 411 ns 372 ns +10.48%
large_setup 14 ns 16 ns -12.5%
iter_batched_per_iteration 40 ns 38 ns +5.26%
iter_batched_ref_per_iteration 40 ns 38 ns +5.26%
from_elem[2048] 245 ns 254 ns -3.54%
from_elem[4096] 321 ns 349 ns -8.02%
from_elem_decimal[2048] 259 ns 240 ns +7.92%
bench_array1[10] 10 ns 9 ns +11.11%
bench_array2[10] 10 ns 9 ns +11.11%
init_array[1000] 1.8 µs 2 µs -12.62%
fibo_10 2 ns 1 ns ×2
🆕 bench_large_input N/A 50.5 ms N/A
🆕 bench_large_input_local N/A 50.4 ms N/A
🆕 fib_10 N/A 428 ns N/A
🆕 fib_20 N/A 52.4 µs N/A
🆕 fib_30 N/A 6.5 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@not-matthias not-matthias merged commit c9b70bf into main Oct 2, 2025
22 of 27 checks passed
@not-matthias not-matthias deleted the cod-1374-codspeed-rust-add-perf-v2-support branch October 2, 2025 10:00
@not-matthias not-matthias changed the title Cod 1374 codspeed rust add perf v2 support feat add perf v2 support Oct 2, 2025
@not-matthias not-matthias changed the title feat add perf v2 support feat: add perf v2 support Oct 2, 2025
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.

2 participants