Skip to content

fix: benchmark timing broken on macOS#6

Open
hobostay wants to merge 1 commit into
aattaran:mainfrom
hobostay:fix/macos-benchmark-timing
Open

fix: benchmark timing broken on macOS#6
hobostay wants to merge 1 commit into
aattaran:mainfrom
hobostay:fix/macos-benchmark-timing

Conversation

@hobostay
Copy link
Copy Markdown

@hobostay hobostay commented May 4, 2026

Summary

  • Replaces date +%s%3N with python3 -c 'import time;print(int(time.time()*1000))' as the primary timing method in run_benchmark()

Problem

date +%s%3N is a GNU coreutils extension. macOS ships BSD date, which does not support %N. Crucially, BSD date does not fail — it outputs garbage like 1714841232%3N (literal %3N), so the || python3 ... fallback never triggers. The subsequent $((end_ms - start_ms)) arithmetic either produces wrong results or errors under set -e.

Test plan

  • On macOS: run ./deepclaude.sh --benchmark → should show reasonable ms timings
  • On Linux: run ./deepclaude.sh --benchmark → should still work (python3 is widely available)

🤖 Generated with Claude Code

`date +%s%3N` is a GNU coreutils extension not supported by BSD date on
macOS. On macOS it silently outputs garbage like `1714841232%3N` without
failing, so the python3 fallback never triggers and the elapsed time
calculation produces wrong results or arithmetic errors under `set -e`.

Use python3 as the primary method (available on both platforms since
macOS ships python3), with a seconds-only fallback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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