nodejs / nodejs/performance

Atomic condition variable

Open
#5 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

benchmark-needed
Dominant language
Shell
Stars
399
Forks
11
Avg merge
29m
Merged PRs (30d)
1

Description

I've noticed that using Atomics.notify + Atomics.waitAsync is extremely slow. Just doing a normal Atomics.load + setTimeout polling loop is a lot faster.

Since Atomics is implemented in V8 I'm not sure there is much we can do about it. Other than maybe adding notes in our docs.

Refs: https://github.com/pinojs/thread-stream/blob/main/lib/wait.js
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=13483

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced lib/wait.js implementation and compare its Atomics.waitAsync/Atomics.notify path with the Atomics.load plus setTimeout polling approach. Review the linked V8 issue for relevant context; the work is not defined until the project decides whether the outcome should be a fix, benchmark, or documentation note.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.