Skip to content

Conversation

@anonrig
Copy link
Member

@anonrig anonrig commented Dec 9, 2025

No description provided.

@anonrig anonrig force-pushed the yagiz/fix-benchmarks branch from eeef244 to 7c1fda0 Compare December 9, 2025 15:25
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 9, 2025

CodSpeed Performance Report

Merging #1034 will improve performances by ×7,900

Comparing yagiz/fix-benchmarks (7c1fda0) with main (662de99)

Summary

⚡ 1 improvement
✅ 9 untouched
🆕 9 new
⏩ 3 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
BasicBench_whatwg 213,693.2 µs 27 µs ×7,900
🆕 Bench_BasicBench_AdaURL_href N/A 32.9 µs N/A
🆕 BBC_BasicBench_AdaURL_aggregator_href N/A 16.3 µs N/A
🆕 BBC_BasicBench_AdaURL_CanParse N/A 12.1 µs N/A
🆕 Bench_BasicBench_AdaURL_CanParse N/A 18.5 µs N/A
🆕 BenchData_BasicBench_AdaURL_href N/A 133.2 ms N/A
🆕 Bench_BasicBench_AdaURL_aggregator_href N/A 25.1 µs N/A
🆕 BenchData_BasicBench_AdaURL_CanParse N/A 68 ms N/A
🆕 BBC_BasicBench_AdaURL_href N/A 23.8 µs N/A
🆕 BenchData_BasicBench_AdaURL_aggregator_href N/A 95 ms N/A

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link

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 fixes benchmarks and integrates with CodSpeed by addressing naming conflicts and improving Rust FFI safety. The changes ensure that multiple benchmark executables can be built without symbol collisions, and enhance the safety documentation for Rust FFI functions.

  • Introduces a macro-based prefix system for C++ benchmarks to avoid naming conflicts across multiple benchmark executables
  • Updates Rust FFI functions to properly mark unsafe operations and adds safety documentation
  • Updates ICU library dependencies from version 1.5.x to 2.1.x in the Cargo.lock file

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
benchmarks/competitors/servo-url/lib.rs Adds safety documentation and marks FFI functions as unsafe, improving Rust safety guarantees
benchmarks/competitors/servo-url/Cargo.lock Updates ICU and related dependencies from 1.5.x to 2.1.x versions
benchmarks/benchmark_template.cpp Introduces macro system (BENCHMARK_PREFIX) to namespace benchmark names and use RegisterBenchmark instead of BENCHMARK macro
benchmarks/bench.cpp Defines BENCHMARK_PREFIX as Bench_ before including template
benchmarks/bbc_bench.cpp Defines BENCHMARK_PREFIX as BBC_ before including template
benchmarks/CMakeLists.txt Adds compile definitions for BenchData_ prefix to benchdata target

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

return;
}

unsafe { drop(Box::from_raw(raw)) }
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

This unsafe block is redundant. The function is already declared as unsafe, so the entire function body is already in an unsafe context. You can remove the unsafe wrapper and just call drop(Box::from_raw(raw)) directly.

Suggested change
unsafe { drop(Box::from_raw(raw)) }
drop(Box::from_raw(raw))

Copilot uses AI. Check for mistakes.
pub unsafe extern fn free_string(ptr: *const c_char) {
pub unsafe extern "C" fn free_string(ptr: *const c_char) {
// Take the ownership back to rust and drop the owner
let _ = unsafe { std::ffi::CString::from_raw(ptr as *mut _) };
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

This unsafe block is redundant. The function is already declared as unsafe, so the entire function body is already in an unsafe context. You can remove the unsafe wrapper and just call std::ffi::CString::from_raw(ptr as *mut _) directly.

Suggested change
let _ = unsafe { std::ffi::CString::from_raw(ptr as *mut _) };
let _ = std::ffi::CString::from_raw(ptr as *mut _);

Copilot uses AI. Check for mistakes.
@CarlosEduR
Copy link
Member

LGTM

image

@anonrig anonrig merged commit 236e519 into main Dec 9, 2025
51 of 52 checks passed
@anonrig anonrig deleted the yagiz/fix-benchmarks branch December 9, 2025 19:03
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