]> git.ardis.lu - csvio/commit
Increase `highWaterMark` for `CSVWriter`'s queuing strategy
authorArdis Lu <ardisglu@gmail.com>
Fri, 4 Jul 2025 05:02:25 +0000 (22:02 -0700)
committerArdis Lu <ardisglu@gmail.com>
Fri, 4 Jul 2025 05:02:25 +0000 (22:02 -0700)
commitc6eeb119fcf503aa030839c6ecfe55394bcc2bee
treeae72360236c73cd060ce987321e65e34551aacc3
parent57396cd5682b88aebcadad7ab5e45f9db4a3df5b
Increase `highWaterMark` for `CSVWriter`'s queuing strategy

This change improves the 100MB Write benchmark from ~9s to ~7s.

Bumping `highWaterMark` to >1 also changes the stream's interaction with `AbortController`, so now the chunk processed during an abort is included in the write.

I believe this behavior has to do with the task queue order of the callback for the `AbortSignal`'s `abort` event - so now with multiple chunks in the queue, the last chunk is written before the `abort` event is processed. I was unable to force this writing code to occur after the `abort` event in a deterministic way.

This situation is a rare edge case so letting it through.
examples/data/ex1_7-out.csv
examples/ex1_7.js
src/core.js
This page took 0.046236 seconds and 4 git commands to generate.