Expand description
Node perf_hooks module.
Exposes the performance object. performance.now() returns REAL monotonic
milliseconds elapsed since a process-start reference captured lazily in a
OnceLock (std::time::Instant — a true monotonic clock, never faked or
fuzzed). timeOrigin is the wall-clock time (Unix ms) at that same reference
point, so timeOrigin + now() approximates Date.now() as Node guarantees.
mark/measure/getEntriesByName/getEntriesByType/clearMarks are
implemented against a small in-process entry buffer guarded by a Mutex. This
is best-effort: entries accumulate for the life of the process and the buffer
is not bounded (Node’s PerformanceObserver / buffered-entry eviction is not
modeled), but marks and measures created and queried within a run behave
correctly.
performance is surfaced as a Builtin("performance") namespace value, so
performance.now() dispatches through call_method → call_builtin_function
(“performance.now”) → this module’s call, and performance.timeOrigin
reads through namespace_property → this module’s constant. The parent wires
BOTH the perf_hooks and performance namespaces to call/constant (see
the wiring note in the accompanying report).
Constants§
- HISTOGRAM_
METHODS - Methods dispatched on an
@@native = "Histogram"object (fromcreateHistogram()/monitorEventLoopDelay(); reported to the parent forinstance_has_method/instance_callwiring). - METHODS
- Methods available on both the
perf_hooksmodule and itsperformanceobject. (timeOriginis a data property, served byconstant.) - OBSERVER_
ENTRY_ LIST_ METHODS - Methods dispatched on an
@@native = "PerformanceObserverEntryList"object. - PERFORMANCE_
OBSERVER_ METHODS - Methods dispatched on an
@@native = "PerformanceObserver"object.
Functions§
- call
- constant
- Non-function properties of
perf_hooks/performance. - construct
new PerformanceObserver(callback)— build an observer holding its callback, its subscribed entry types, and a pending-entries buffer. Reported to the parent forconstructwiring.- entry_
list_ instance_ call - Dispatch a method on a
PerformanceObserverEntryListinstance. - histogram_
instance_ call - Dispatch a method on a
Histograminstance (@@native = "Histogram"). - observer_
instance_ call - Dispatch a method on a
PerformanceObserverinstance.