Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
env:
CODSPEED_GO_PKG_VERSION: ${{ github.head_ref || github.ref_name }}
with:
runner-version: branch:cod-2057-perf-timeout-in-codspeed-go-makes-benchmark-hang

Choose a reason for hiding this comment

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

dont forget to drop this

mode: walltime
working-directory: example
run: cargo r --release --manifest-path ../go-runner/Cargo.toml -- test -bench=. ${{ matrix.target }}
Expand Down
4 changes: 2 additions & 2 deletions example/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func expensiveOperation() uint64 {
}

// Expensive recursive computation that will dominate flamegraph
fibResult := recursiveFib(30)
fibResult := recursiveFib(15)

// More expensive work - sum the data
sum := uint64(0)
Expand All @@ -40,6 +40,6 @@ func doWork(n int) uint64 {

func actualWork() uint64 {
time.Sleep(1 * time.Millisecond)
result := doWork(30)
result := doWork(15)
return 42 + result
}
5 changes: 5 additions & 0 deletions go-runner/src/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ fn run_cmd<P: AsRef<Path>>(
let mut cmd = Command::new(go_binary);
cmd.args([
"test",
// Disable stripping of symbols and debug information
"-ldflags=-s=false -w=false",
// Keep the test binary on disk after executing it. This is required by
// the runner to properly parse the symbols and debug info.
"-work",

Choose a reason for hiding this comment

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

Minor, but is there an easy way to clean this up ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately no, because we need the test binary to exist when the runner executes the teardown.

The only alternative I see to this, is to parse the first line (and drop it) and then copy the test binary (which is always called {name}.test) to another folder. Wdyt?

"-overlay",
&overlay_file.to_string_lossy(),
"-bench",
Expand Down
Loading