Skip to content

What's the status of async_local_storage scope implementation? #1060

Closed
@zen0wu

Description

@zen0wu

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?

@Qard @rochdev Mentioned people on the original PR 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions