Open source · Performance & Reliability

Long Task Analyzer

Find long tasks and associate them with script, route and interaction timing.

v0.1.0 · Node.js 22+ · MIT

Browse the public repository · View releases

An offline reporter for a documented, normalized subset of a saved browser trace. It identifies main-thread tasks of at least 50 ms and attributes their duration to route, script, and interaction windows where the export supplies enough evidence. Unknown or overlapping context remains an explicit unknown bucket. This makes blocking time visible without inventing source-level detail.

This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+; inspect the source before using it on your own files.

Run the checked-in example

node bin/long-task-analyzer.mjs --root examples --input pass.json
node bin/long-task-analyzer.mjs --root examples --input blocking.json
node bin/long-task-analyzer.mjs --root examples --input unknown.json
npm run check

Read the result

The examples exit 0, 1, and 2 respectively. Stdout is one JSON report. Stderr has a fixed human summary unless --json is present. --help alone prints usage. Optional --report FILE writes exactly the stdout bytes to a separate path under --root; it refuses a symlink destination, symlinked parent escaping root, hard link or path alias to an input, including a dangling one- or two-hop input symlink. A refused or failed write emits an incomplete report on stdout and exits 2; no task is claimed as analyzed in that report.

Where this check stops

This local walkthrough does not establish the state of a live production system or replace the limits documented in the repository.

Before adapting the command to your own workflow, review the accepted inputs, exit codes and safety boundaries in the README.

Compiled with AI assistance from checked-in public documentation and example scripts. Run the example and review the repository's current documentation before relying on its result.