perf-utils
Few functions to measure performance and other useful stuff in a node.js app. Available on npm.js!
npm i perf-utils-js
Functions
memLog
// returns value of current heap used by node.js process in MB
function memLog(): number
profileFn
// returns a log of the average execution time of a given function
// calculated over 'iter' iterations
function profileFn(fn: CBFuncVariadicAnyReturn, iter?: Number): ProfileFnLog
sizeof
// returns rough estimate of B used by an object
function sizeof(obj: any): number
compareFnProfile
// compares N fuctions by average execution time over 'iter' iterations
// returns fastest function's log and a list of all the logs calculated
function compareFnProfile(iter: number, ...functions: CBFuncVariadicAnyReturn[]): CompareFnLog;