sindresorhus/refined-github

Log feature performance #3032

fregante posted onGitHub

Some features may be slow: https://github.com/sindresorhus/refined-github/issues/3029

What if our init runner also tracked the time and logged it together with the filename?

https://github.com/sindresorhus/refined-github/blob/90897d65eb2005330178cd049070982113774b5b/source/libs/features.tsx#L110-L112

This would miss slowdowns that happen outside the init (e.g. in click listeners) but it may be better than nothing.

The log line would include something like time > 20 ? time + 'ms' : '', or even using log colors to highlight slow features (time > 40)


Async functions can pause execution at any time so their "execution time" is meaningless. Features can't be profiled this way.

posted by fregante over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests