Skip to main content

Performance trace format

Keep the event stream, then make it queryable.

Chrome Trace Event files describe process, thread, duration, instant, counter, and flow events as JSON. loaders.gl normalizes common identifiers and exposes them as Arrow columns without discarding extra fields.

loaders.gl support​

The event model

Use phase codes to describe time and relationships.

A trace event is small, but its phase, identifiers, timestamps, duration, and arguments give it meaning. The loader makes those fields stable for analysis and preserves data it does not model directly.

Phases

Duration, instant, counter, metadata, and flow events

Identity

Process, thread, async, and flow identifiers

Columns

Stable Arrow fields plus JSON for extra values

Round trip

Writer restores metadata and logical event fields

Chrome Trace Event files are JSON objects with a top-level traceEvents array. They are produced by Chrome, Chromium-based tools, Node.js, and many profiling libraries.

Detailed guide

Chrome Trace events and Arrow output

The sections below describe event phases, the Arrow representation, metadata, streaming behavior, and round-trip guarantees.

{
"displayTimeUnit": "us",
"metadata": {"source": "example"},
"traceEvents": [
{"name": "process_name", "ph": "M", "pid": 100, "tid": 0, "args": {"name": "Renderer"}},
{"name": "ParseHTML", "ph": "X", "ts": 1000, "dur": 3200, "pid": 100, "tid": 1}
]
}

Event Model​

Every event has a name and phase code ph. Other fields depend on the phase.

Common phaseMeaningTypical fields
B, EDuration begin and endts, pid, tid
XComplete durationts, dur, pid, tid
i, IInstantts, scope or s
CCounter samplets, numeric values in args
s, t, fFlow start, step, and endts, id or bind_id
b, n, eNestable async begin, instant, and endts, id, scope or s
MProcess or thread metadatavalues in args

pid, tid, id, and bind_id can be numbers or strings in source files. Arrow output normalizes these identifier-like values to UTF-8 strings so values outside JavaScript's safe integer range are not rounded.

Arrow Representation​

Whole-file Arrow output has stable columns for common fields and preserves unmodeled fields in extraJson.

ColumnArrow typeNullableDescription
nameUtf8noEvent name.
phUtf8noPhase code.
tsFloat64yesTimestamp in the source display unit.
pid, tidUtf8yesNormalized process and thread identifiers.
catUtf8yesCategory string.
dur, tdur, ttsFloat64yesDuration and thread-time values.
id, bind_idUtf8yesNormalized async or flow identifiers.
scopeUtf8yesInstant or async scope.
argsUtf8yesJSON-encoded argument object.
extraJsonUtf8yesJSON-encoded source fields without dedicated columns.

Streamed batches use direct JSON-table columns. They expose s and scope separately and preserve id2 as JSON text. The Arrow adapter normalizes those batches back to logical Chrome events before they reach live trace sessions.

File Metadata​

displayTimeUnit and top-level metadata are stored in Arrow schema metadata. The writer and Arrow stream adapter restore them automatically. Writer options can override both values.

Round-Trip Behavior​

ChromeTraceLoader with shape: 'arrow' and ChromeTraceWriter preserve:

  • args objects through JSON text
  • unknown event fields through extraJson
  • numeric and string identifier values without numeric coercion
  • metadata events that do not have timestamps
  • top-level displayTimeUnit and metadata
  • async scope under s for phases b, e, and n, and under scope for other phases

JSON object key order and insignificant whitespace are not preserved.