mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
- Port messages that a 'message' listener posts while more worker messages are queued are delivered after those messages and before setImmediate callbacks, as in Node. The ports' poll phase waits while a batch's next message is queued, and the loop pass continues once more after the batch when a port has something to deliver. - A mailbox counts its queued events per kind as they are posted and taken, so starting a batch reads the count instead of scanning the queue under the lock. Messages that alternate with a worker's captured stdout or stderr start a batch each, which made delivery quadratic: 20000 such messages took 5.6 s to drain, and now take 0.5 s (Node 0.57 s). - The continue hook passes on that the batch's next message is at the head, so the dispatch that follows does not lock the mailbox again. - Corpus 6212 checks the order of worker messages, a MessageChannel message posted by the first listener, and setImmediate against Node. 6211's costs are now taken from its CI timings.