8000 Use portable benchmark output redirection by dajiaohuang · Pull Request #1780 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Use portable benchmark output redirection - #1780

Open
dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/benchmark-shell-redirect
Open

dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/benchmark-shell-redirect

Conversation

@dajiaohuang
@dajiaohuang dajiaohuang commented Oct 1, 2026 •
Copy link
Copy Markdown

Replace Bash-specific &> redirection with >/dev/null 2>&1 in the benchmark wrapper. _benchmarks/bench.sh invokes this executable, which has no shebang, through env time. In the verified Ubuntu invocation, the old form runs the analysis command asynchronously and time records the wrapper exit rather than the complete command runtime.

Validation: used the source wrapper and actual env time invocation, substituting only the hardcoded Staticcheck binary with a command that sleeps for 0.4 seconds. The original wrapper reported 0.00 seconds; the proposed redirection reported 0.42 seconds. This establishes the wrapper timing defect, not a real Staticcheck benchmark/performance measurement. The exact newly created probe directory was removed successfully.

Scope: only redirection changes. The unrelated generic-instantiation change was previously removed in favor of #1764. Historical Bash syntax and git diff --check passed; no full distribution or real benchmark run is claimed.

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.

1 participant

0