Skip to content

perf(runner): fold clock perl probe into the first read#802

Merged
Chemaclass merged 1 commit into
mainfrom
perf/clock-fold-perl-probe
Jul 15, 2026
Merged

perf(runner): fold clock perl probe into the first read#802
Chemaclass merged 1 commit into
mainfrom
perf/clock-fold-perl-probe

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Follow-up to the cold-start profiling in #798. Selecting the perl clock impl forked perl twice at cold start: an empty Time::HiRes verification probe, then a separate first time read.

💡 Changes

  • Read the actual time during impl selection and seed the return slot, so the first now_to_slot reuses it instead of forking a second interpreter.
  • A non-digit/empty result still falls through to the next impl, preserving the fallback chain.
  • 2 → 1 perl fork per cold start on bash 3.2 / macOS (Linux/BSD use date, unaffected); regression test extended.

Selecting the perl clock impl forked perl twice at cold start: an empty
`perl -MTime::HiRes -e ''` verification probe, then a separate first read.
Read the actual time during selection instead and seed the return slot, so
now_to_slot reuses it. A non-digit/empty result still falls through to the
next impl, preserving the fallback chain.

2 -> 1 perl fork per cold start on bash 3.2 / macOS (Linux/BSD use date,
unaffected). No behaviour change.
@Chemaclass Chemaclass added the enhancement New feature or request label Jul 15, 2026
@Chemaclass Chemaclass self-assigned this Jul 15, 2026
@Chemaclass Chemaclass merged commit 40e6e76 into main Jul 15, 2026
37 checks passed
@Chemaclass Chemaclass deleted the perf/clock-fold-perl-probe branch July 15, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant