Skip to content

Event Loop poll with no io pending is slow on macos #61843

@billywhizz

Description

@billywhizz

I wrote the details of this up here.

It relates to this tweet, which some of you may have seen.

Image

To summarise:

  • We could propose a change to libuv or float some patches on top of it which removes a ~12µs delay when we poll the event loop and there is no pending io
  • This results in 25x (~2m ticks versus ~80k ticks per second) better throughput for setImmediate in the microbench provided in the gist above and on the original tweet from Jarred Sumner
Image

Am happy to work on a PR for node.js or libuv if folks think this is worth doing and/or likely to land.

Haven't worked out the actual logic for when to set this flag yet so would likely need some feedback on that from the libuv maintainers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions