runtime-perf
v1.0.4
Published
[](https://www.npmjs.com/package/runtime-perf) [](https://opensource.org/licenses/MIT)
Downloads
12
Maintainers
Readme
runtime-perf 🚀
A lightweight, real-time performance profiler for Node.js applications that tracks function execution times, memory usage, and CPU bottlenecks with minimal overhead.
Features ✨
- ⏱️ Accurate function timing with nanosecond precision
- 📊 Automatic performance reports and flamegraphs
- 🧠 Memory usage tracking and leak detection
- 🔍 Event loop monitoring
- 💡 Works with both synchronous and async functions
- 🔧 Zero configuration required
Installation 📦
npm install runtime-perf --save-dev
# or
yarn add runtime-perf --Basic Usage 🛠️
const { ExecutionTracker } = require('runtime-perf');
const tracker = new ExecutionTracker();
// Wrap your functions
const trackedFunction = tracker.wrapFunction(function expensiveOperation() {
// Your code here
}, 'expensiveOperation');
// Execute
trackedFunction();
// Generate report
console.table(tracker.generateReport());CLI Usage
npx runtime-perf monitor your-script.js
# With flamegraph generation
npx runtime-perf monitor your-script.js --flamegraph