Closed riston closed 5 years ago
The threshold shouldn't affect the performance or memory consumption. This tool stores a stack trace for each async function and removes it once the function is done. Hooks themselves are going to affect your app performance power nie initialized. That's expected.
Seems like it's not the issue with library itself but more the performance hit of using async hooks(https://github.com/bmeurer/async-hooks-performance-impact)
I'm going to document the performance impact and explicitly explain this should not be run in production by default.
warning added
Using this method to monitor event loop lag causes additional load to memory and CPU in my case this was about ~15%.
I started with a rather large threshold value five seconds, could that cause just filling the cache map with stack traces and now cleaning up that fast https://github.com/naugtur/blocked-at/blob/master/index.js#L4L4 ?