You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node:perf_hooks: make performance.now relative to timeOrigin #3012
Node performance.now() returns high-resolution milliseconds since performance.timeOrigin, not milliseconds since the Unix epoch. Perry currently implements js_performance_now() as epoch milliseconds, which makes performance.now() roughly equal to Date.now() and breaks User Timing start times/durations that rely on the same helper.
Local Node v25.9.0 reported performance.now() around tens of milliseconds, performance.timeOrigin around epoch milliseconds, and timeOrigin + now within 1ms of Date.now().
crates/perry-runtime/src/perf_hooks.rs::time_origin_ms() also stores an epoch-millisecond timestamp.
crates/perry-runtime/src/perf_hooks.rs::perf_now() delegates to crate::date::js_performance_now(), so default performance.mark() start times, performance.measure() durations, and event loop utilization calculations inherit epoch-millisecond values instead of relative timestamps.
Dynamic dispatch and static lowering for performance.now call js_performance_now() directly.
Expected
performance.now() should return a monotonic, high-resolution duration relative to the fixed performance.timeOrigin. performance.timeOrigin + performance.now() should approximate wall-clock Date.now(), while performance.now() itself should be a small process-relative value.
Duplicate checks
performance.now timeOrigin epoch
perf_hooks now relative timeOrigin
PR search for performance.now timeOrigin
I did not find an existing issue for performance.now() being epoch-based.
I am taking this in a focused node:perf_hooks timing and validation PR cut with #3013, #3011, #3010, #3008, and #3088. Intended scope: make performance.now() relative to a process-start timeOrigin, support two-argument eventLoopUtilization() diffs, and align the related User Timing / observer validation behavior. Non-goals: timerify() function entries and markResourceTiming() resource entries, which fit a separate observable-entry cut.
Activity
andrewtdiz commentedon May 31, 2026
I am taking this in a focused
node:perf_hookstiming and validation PR cut with #3013, #3011, #3010, #3008, and #3088. Intended scope: makeperformance.now()relative to a process-starttimeOrigin, support two-argumenteventLoopUtilization()diffs, and align the related User Timing / observer validation behavior. Non-goals:timerify()function entries andmarkResourceTiming()resource entries, which fit a separate observable-entry cut.andrewtdiz commentedon May 31, 2026
Opened PR #3508 to close this: #3508
Verification on the rebased branch:
./run_parity_tests.sh --suite node-suite --module perf_hookspassed 78/78.cargo check -p perry-runtime -p perry-codegen -p perry-hir -p perry-api-manifest -p perrypassed.cargo fmt --all -- --check,./scripts/check_file_size.sh,jq empty test-parity/known_failures.json, andgit diff HEAD~1..HEAD --checkpassed.