rsgalloway / pyseq

Compressed sequence string module for Python
https://pyseq.rsgalloway.com/
Other
123 stars 36 forks source link

use scandir instead of os.walk()? #48

Closed herronelou closed 2 months ago

herronelou commented 6 years ago

Hi. Just wondering if using scandir instead of os.walk would increase performance when doing a pyseq.walk()?

nebukadhezer commented 6 years ago

I guess it should make a huge difference. try: from scandir import walk as walkFunction except ImportError: from os import walk as walkFunction

I used it like this in other modules.. @rsgalloway I could make a seperate PR for this ?

rsgalloway commented 6 years ago

Sure, definitely worth testing. As I said in your other PR, we should add some regression tests to evaluate these things more consistently. I'll need to look into what CI testing is supported on github because it'd be interesting to see if performance could be tracked over time.

herronelou commented 5 years ago

Hi, I've given a try to this, and while it does speed up performance (in python 2.7), it changes the return types to unicode, which as we've seen in issue #45 is not always a great idea. I didn't push too far, but if you do make a patch for it make sure there's no regression there I guess.

rsgalloway commented 2 months ago

implemented some performance improvements in 0.7.0, closing this

https://github.com/rsgalloway/pyseq/pull/71