Sep 6, 2018 · 1 min read
I’d be interested to compare your “async code” which still runs sequentially, versus actually leveraging node’s IO threads and running these file reads in parallel. Presumably, running code both in async and in parallel would give a much different picture of the performance inpact of using sync code.
At this point in Node’s development, one could also promisify the fs.readFile function and run all of this as promises, ending the counter when Promise.all(ret) has resolved. I’m sure that’d be interesting benchmarks also.