I Built a Tiny Function Profiler That Changed How I Debug JavaScript
dev.toยท4hยท
Discuss: DEV
๐Ÿ“ŠProfiling Tools
Preview
Report Post

Have you ever wondered:

  • "Why is this function so slow?"
  • "How many times is this being called?"
  • "Where exactly is my code failing?"

I was asking myself these questions every single day. So I built a tool to answer them.

Introducing function-trace โ€” a tiny, zero-dependency function profiler for JavaScript and TypeScript.


๐Ÿคฏ The Problem

Last month, I was debugging a production issue. An API endpoint was randomly slow, but I couldnโ€™t figure out which function was the culprit.

My debugging process looked like this:

const start = performance.now();
const result = await someFunction();
const end = performance.now();
console.log(`someFunction took ${end - start}ms`);

I was copy-pasting this **evโ€ฆ

Similar Posts

Loading similar posts...