3 ms·
Would you mind changing the submission title? Your library simply does not glob (that's a word with fixed meaning), which is likely a rather expensive part of t
by tastroder 7y ago
Would you mind changing the submission title? Your library simply does not glob (that's a word with fixed meaning), which is likely a rather expensive part of the hot path for real use cases.
Aside: Looking at the hyperfine results below, have you benchmarked this JS optimization vs. implementing it in C++ instead and consuming the results of that?
- thecodrr 7y agoHey, thanks for the interest. No, I cannot change the title because I don't have editing capabilities anymore. I don't see the point of implementing it in c++ simply because I wanted to keep it simple, dependency free and easy to maintain. The fact that I know very little C++ also influenced that decision. Moreover, I am sure that way would be faster (from my understanding).
- tastroder 7y agoThe upside would be that you can specifically control when to pass values between the underlying C++ and the v8 runtime. But anyway, this implementation is quite nice. I tried to recreate a more meaningful benchmark between a few of the libraries you compared with but on a real file system structure rrdir and node-walk just noped out by exceeding the maximum call stack size. Increasing that yielded pretty much the same results as your library for rrfind in the sync setting with the overhead likely being down to that one returning an object (mean difference between 50-100ms higher on ~1.1 million files).
- thecodrr 7y agoYou give a very valid reason to tryout an implementation in C++. I will definitely look into it. Thanks. Would love to see the benchmark results! Do share a link if you can. Thanks for auditing and taking the interest!