perf-marks
Advanced tools
Changelog
[1.12.0][] - 2020-07-31
profiler()
to profile functions using perf-marks. The idea here is to avoid boilerplates on consumer's side by having an easy way to do that. So instead of doing thisimport { start, end } from 'perf-marks/marks';
const markName = 'name-of-the-mark-for-this-method';
const methodToBeMeasured = () => {
/** method content */
};
// ...
start(markName);
const data = methodToBeMeasured();
const mark = end(markName);
return { data, mark };
The consumers can have same effect by doing this
const methodToBeMeasured = () => {
/** method content */
};
// `res` will contain `mark` with the information and `data`
// if `methodToBeMeasured` returns something
const res = profiler(methodToBeMeasured, 'name-of-the-mark-for-this-method');
perf-marks/utils
Changelog
[1.11.0][] - 2020-07-25
isNodeJSEnv
: Boolean with the result of the check if package is running on the browser or in a NodeJS environmentisPerformanceObservableSupported
: Boolean with the result of the check if PerformanceObservable
is supported for the current browser/NodeJS versionisUserTimingAPISupported
: Boolean with the result of the check if User Timing API is supported for the current browser/NodeJS versionChangelog
[1.10.1][] - 2020-07-25
yarn bundlesize
commandChangelog
[1.10.0][] - 2020-07-24
Changelog
[1.9.0][] - 2020-07-24
Changelog
[1.8.1][] - 2020-05-13
tslib
to v1.12.0
nodejs
to v12.16.2
engines
in package.json
to accept NodeJS versions only greater or equal than >=12
Changelog
[1.8.0][] - 2020-02-16
isPerformanceObservableSupported
boolean for check if PerformanceObservable
is supported for the current browser/NodeJS versionimport * as PerfMarks from 'perf-marks';
...
// Checking if `PerformanceObservable` is supported for the current browser/NodeJS version
if (PerfMarks.isPerformanceObservableSupported) {
try {
// If yes, start the PerformanceObserver
const observer: PerformanceObserver = new PerformanceObserver(list => {
// ... Do something
});
// register observer based on the entryTypes
// E.G. for long task notifications
observer.observe({ entryTypes: ['longtask'] });
} catch (e) {}
// ... Finishing the observer
observer.disconnect();
}
...
uglifyjs
to uglify-js
due to package deprecationChangelog
[1.7.0][] - 2020-01-18
README.md
docs with latest changes176B
🎉Changelog
[1.6.0][] - 2019-11-14
Webpack
, Rollup
, or Parcel
.babel
packages from dependencies. Not needed anymore after move to rollup
buildChangelog
[1.5.1][] - 2019-11-08
rollup
as UMD resolver