Files
scriptc/tests
Chris Tate 3005acc14f Deliver fs callbacks without a timer turn
The fs error-first callbacks (readFile, writeFile, stat, access, mkdir and
the other callback forms that complete synchronously) and fs.exists
delivered their callback through a zero-delay timer. Timers have a 1 ms
floor, so every callback waited about 1 ms: 5000 sequential readFile
callbacks took 5.5 s, where Node takes about 0.35 s.

The callbacks now go on a FIFO queue that the event loop drains like the
worker-pool completions: one callback per checkpoint, with nextTicks and
microtasks drained between callbacks. A turn delivers the callbacks that
were queued when its timers ran, as libuv's poll phase does, so a
callback that queues another leaves room for timers and immediates.

Corpus 5555 covers the order against the synchronous code and its
microtasks, and timers and immediates during a chain of 2000 callbacks.
2026-10-16 00:26:28 -05:00
..
2026-07-22 18:08:04 -05:00