Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ jobs:

- name: Run the benchmarks
uses: CodSpeedHQ/action@main
env:
CODSPEED_SKIP_UPLOAD: "true"
with:
run: cargo r --release --manifest-path ../go-runner/Cargo.toml -- test -bench=. example -benchtime=500ms
run: |
echo "PATH=$PATH"
which -a go
go env GOROOT || echo "go env GOROOT exited $?"
cargo r --release --manifest-path ../go-runner/Cargo.toml -- test -bench=BenchmarkFibonacciDarwin example -benchtime=500ms
working-directory: example
mode: walltime
# TODO: Remove this once the runner has been released with macos support
runner-version: branch:main

go-runner-benchmarks:
Expand Down
11 changes: 11 additions & 0 deletions example/fib_darwin_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build darwin

package example

import "testing"

func BenchmarkFibonacciDarwin(b *testing.B) {
for b.Loop() {
fibonacci(25)
}
}
14 changes: 12 additions & 2 deletions go-runner/src/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,20 @@ fn run_cmd<P: AsRef<Path>>(

// Convert the CLI struct into a command:
let mut cmd = Command::new(go_binary);

// On macOS, Go 1.26+ invokes dsymutil to extract DWARF into a .dSYM bundle.
// dsymutil can be OOM-killed on large cgo binaries, failing the build.
// Walltime mode never reads DWARF symbols, so disabling them on macOS is safe.
// On Linux, keep symbols for simulation/callgrind profiling.
let ldflags = if cfg!(target_os = "macos") {
"-ldflags=-w"
} else {
"-ldflags=-s=false -w=false"
};

cmd.args([
"test",
// Disable stripping of symbols and debug information
"-ldflags=-s=false -w=false",
ldflags,
// Keep the test binary on disk after executing it. This is required by
// the runner to properly parse the symbols and debug info.
"-work",
Expand Down
2 changes: 1 addition & 1 deletion go-runner/src/runner/overlay/instrument_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tar::Archive;
use tempfile::TempDir;

const INSTRUMENT_HOOKS_REPO: &str = "CodSpeedHQ/instrument-hooks";
const INSTRUMENT_HOOKS_COMMIT: &str = "ecdf31a3afd0fb879823e40df65129ec823d374b";
const INSTRUMENT_HOOKS_COMMIT: &str = "d83209f91683cf4c1677bdde28e0e43ca201f6ed";

/// Get the instrument-hooks directory, downloading if necessary
/// Downloads to /tmp/codspeed-instrument-hooks-{commit}/
Expand Down
Loading