perftrace
Visualize Performance issues in your JavaScript Applications
A lightweight tracing tool that records how long parts of your JavaScript code take and lets you view the timing as a visual timeline in Google's Perfetto viewer.
Explanation
Perftrace is a tool that helps you find slow spots in your JavaScript code by recording how long different operations take and showing you a visual timeline. Instead of staring at numbers in a console, you get a colorful chart where you can see exactly which parts of your app are eating up time—whether it's loading modules, waiting for network requests, or running loops.
The way it works is straightforward. You add a few lines to your code that tell perftrace to "watch" what's happening—things like when a function starts and stops, or how long it takes to require a file. Perftrace collects all this timing data and saves it in a standard format that other tools already know how to visualize. Specifically, it uses Google's Perfetto viewer (a professional performance analysis tool), so you open your data there and see everything laid out on a timeline. No custom viewer to learn, no weird export formats—just open a file in your browser and dig in.
You'd use this if you're trying to debug why your Node.js server is slow, or why your web app feels sluggish when it loads. For example, if your app takes five seconds to start up and you don't know why, you can run it with perftrace tracking enabled, and the Perfetto view will immediately show you "oh, loading the database module took 2 seconds." It works in both Node.js (the server-side JavaScript runtime) and in web browsers, so it covers both sides of the JavaScript world.
What makes this useful is that it's lightweight and standards-based. You don't need a heavyweight profiler or special setup—just npm install and import. The data format is widely recognized, so if you want to share performance traces with teammates or analyze them with other tools later, it just works.
Where it fits
- Trace a slow Node.js server startup to find which module or require call is eating the most time.
- Profile a sluggish web app's loading sequence and view the results as a timeline in Perfetto.
- Share a standard-format performance trace with teammates or analyze it later with other Perfetto-compatible tools.