Заполните пропущенные слоты заранее. Просто не верьте тому, что говорят.

DEV · 22.11.2026 · 10:00

Автор делится опытом работы с массивом результатов и обсуждает влияние первоначального состояния массива на выполнение задач. В комментариях к статье возникли интересные вопросы, касающиеся…

Читать в источнике

Оригинал

Pre-Fill Your Skipped Slots. Just Don't Believe What They Say.

271 milliseconds. That is how long my batch lived before task 4 threw, and it is the only number in this piece that came out the same no matter what I did to the results array. Everything else about the abort changed depending on one small decision made before the first worker started: whether the results array was full of holes, or full of slots marked skipped. johnnylemonny asked about this in the comments on his Promise.all piece, and his question was sharper than most of the replies it got.