Re:Show HN: Fdir – Faster Node.js glob alternative
by thecodrr on Sunday March 29, 2020 @05:29PM
(#22722932)
That is one of the potential use cases behind fdir. I am actively using it for a testing framework (private).
The main methodology was benchmarking every little line of code. Since JS has many alternatives for every thing, I had to benchmark a lot of code.
No special tools were used. The performance gains are mostly from not using recursion, less function calls etc. It could further be optimized of course (and I am working on that).
Thanks for taking the interest :)
Re:Show HN: Fdir – Faster Node.js glob alternative
by ricardobeat on Sunday March 29, 2020 @09:29PM
(#22724404)
Do you mind sharing how you did the benchmarking? console.time, inspector?
Re:Show HN: Fdir – Faster Node.js glob alternative
by thecodrr on Sunday March 29, 2020 @09:32PM
(#22724423)
I used `benny`. If you have a NodeJS setup you can easily run the benchmarks by:
npm install
And then: node benchmark.js
That will start the asynchronous and synchronous benchmark sequentially.Thanks for taking the interest.
Edit: benny uses the Benchmark.js library underneath.
What tools/processes did you use to optimize performance here?