Dev Helpers

Node.js / Performance measurements

Attach details to a mark

Dev Helpers · October 24, 2026

Performance marks can carry details about the operation they describe. Small stable identifiers are easier to aggregate than large payloads.

Worked example

import {
  performance,
  createHistogram,
  PerformanceObserver,
} from "node:perf_hooks";
console.log(performance.mark("load", { detail: { count: 2 } }).detail);

Result

{ count: 2 }

Implementation notes

Marks accumulate unless they are cleared or otherwise bounded. Long-running services should decide how much diagnostic history to retain.

Try it yourself

Record two marks with the same name and different request labels.

Open the Node.js example →

Editorial date October 24, 2026 · Published December 6, 2026

Related articles

Safely parse malformed input

Parsing user-provided JSON needs a failure path. Successful parsing alone does not establish that the result has the expected shape.

Checksum bytes with CRC32

CRC32 is useful for detecting accidental changes to a byte sequence. Record the input encoding so different producers compute the same checksum.

Capture positional arguments

Process arguments include runtime and entry-point information before user arguments. Slice off those positions before interpreting input.