We deserve a better streams API for JavaScript
9 points by bvisness
9 points by bvisness
This is a great read! I noticed in the Performance section that the author quotes "chained 3x transforms" of 8kb x 500 as running at 275GB/s though, which seems incredibly fast compared to what an M1 Pro would allow. An M1 Pro is commonly cited as having ~200GB/s of DRAM bandwidth [1], which would probably put this at faster than memcpy. The only reason I can think of for this being possible is that the data all fits in the L1/L2 cache (which it likely does), but even then I'd be surprised if Node.js was able to place it that efficiently. For comparison numbers, the fastest FizzBuzz I know of [2] is 286GB/s on a AMD 5950X for what seems to be a far simpler problem. If getting this result isn't a measurement error, then it's a great achievement, but I'm a bit skeptical. Could someone who understands all this better than I do explain this?
[1] https://en.wikipedia.org/wiki/Apple_M1#Memory
[2] https://codegolf.stackexchange.com/questions/215216/high-throughput-fizz-buzz/269772#269772