Closed gjtorikian closed 10 years ago
hey. im soooo sorry for not noticing your pull request.
thanks for the feedback. yeah sync support is not necessarily something you normally need in node server programs but ill take any help i can get making all parts of this faster. I'm interested in what you ended up with i didnt see anything on github. perhaps there is a way to get those improvements without loosing features so i can give your boost to everyone.
No worries!
My code can be found at http://WWW.GitHub.com/c9/nak . In the end, I did go with the async format, and just perform a mergesort at the very end of the walk.
I'm pretty sure I've gotten it as quick as can be. I'm sorry to say that I learned EventEmitters are not quick, so perhaps you could choose to emit events on an optional configuration.
i know event emitter 2 is much faster. thanks alot for the link
On Tue, Nov 20, 2012 at 4:00 PM, Garen Torikian notifications@github.comwrote:
No worries!
My code can be found at http://WWW.GitHub.com/c9/nak . In the end, I did go with the async format, and just perform a mergesort at the very end of the walk.
I'm pretty sure I've gotten it as quick as can be. I'm sorry to say that I learned EventEmitters are not quick, so perhaps you could choose to emit events on an optional configuration.
— Reply to this email directly or view it on GitHubhttps://github.com/soldair/node-walkdir/pull/6#issuecomment-10580059.
I wanted a directory walking library that was very performant. Fortunately, I found this one !
I kept making a few tweaks along the way, because I wanted to get the search faster. I learned a lot about Node profiling and Javascript optimizations. Ultimately, I decided to gut your library and take just the parts I needed. I'm contributing back a few pieces of code that dropped my search speed down by a few hundred milliseconds.
Two other tweaks could make this library even faster:
A simple function call is more perfomant. Likewise, not doing the emits when in synch also makes it performant.
allResults.push()
, doingallResults += path + "\n"
is much better at providing a list of results. Possibly because push always takesn
amount of time?I realize both of these pertain to improving the sync speed, but that's because I was concerned with an organized directory search.