Closed
Description
Given async_hooks scope has pretty bad performance (reference #695), it seems that async_local_storage
can be used. Looking at the implementation, it's a much easier/clearer approach.
Based on my own local test, async_local_storage basically has no performance impact as if I set enabled: false
, while async_hooks slowed down the program by about 2x.
But I cannot see any documentation around async_local_storage
, nor it's part of index.d.ts
's type definition of the scope
config (and plus the doc suggest against setting scope
in the first place), so I'm wondering what's the status of that implementation? Is it recommended at all? Has anyone used it in production?