X Tutup
The Wayback Machine - https://web.archive.org/web/20260203034144/https://github.com/nodejs/node/pull/42393
Skip to content

Conversation

@Qard
Copy link
Member

@Qard Qard commented Mar 18, 2022

This is an experiment in moving the machinery necessary for AsyncLocalStorage away from async_hooks and into V8 itself. The purpose is for better performance by entirely eliminating the unnecessary event sequence component of async_hooks and to enable sharing storage state with V8. This is very much a proof-of-concept in its current state. It's failing a bunch of tests still, that's expected, it's not complete yet.

Feel free to have a look and provide feedback on the direction if you like, just keep in mind this is not done yet.

@Qard Qard added v8 engine Issues and PRs related to the V8 dependency. async_hooks Issues and PRs related to the async hooks subsystem. labels Mar 18, 2022
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 18, 2022
@Qard Qard force-pushed the v8-context-storage branch from e0323df to 1c0f44a Compare March 18, 2022 19:45
@RaisinTen
Copy link
Member

The purpose is for better performance

Do you have an estimate of how much of a performance gain this has?

@Qard
Copy link
Member Author

Qard commented Mar 21, 2022

Not yet. Still just focused on making it work. I'll do measurements later.

@Qard
Copy link
Member Author

Qard commented Apr 19, 2022

Had some discussions with V8 folks and they're not keen on moving this much of the API into V8. However, there are some new things in V8 that should help to accommodate this need with a bit of alterations. Certainly https://chromium-review.googlesource.com/c/v8/v8/+/2005849 should be helpful. I'll work on this some more soon. :)

@Qard
Copy link
Member Author

Qard commented May 18, 2022

Pretty sure I'll be able to find a bit more time for this soon. Just challenging with some big projects on my plate getting wrapped up soon and currently being a one person team. My team is hiring if you're looking for piles of stuff to do. 😅

@Qard Qard force-pushed the v8-context-storage branch from 1c0f44a to 87c363b Compare June 28, 2022 03:12
Reimplementation of AsyncLocalStorage to bypass async_hooks.
@Qard Qard force-pushed the v8-context-storage branch from 87c363b to d5507ce Compare June 28, 2022 23:41
@Qard
Copy link
Member Author

Qard commented Jul 11, 2022

Did a bit of restructuring recently to move away from V8 changes. Still more work to do and needs some refactoring to work better when I add support for promises and timers.

@Qard
Copy link
Member Author

Qard commented Jan 24, 2023

Closing as I haven't had the time for this and it sounds like there's some other similar efforts incoming. 😅

@Qard Qard closed this Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async_hooks Issues and PRs related to the async hooks subsystem. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup