I test whether glob() or os.walk() is faster in Python when trying to find files in subdirectories on a harddrive.
Пікірлер: 4
@marvinakuffo40965 күн бұрын
How about using glob as a generator? Would that reduce the gap beteen the os.walk and glob? Because in your code, glob() loads everything into memory and that may adversely impact the runtime.
@ekbphd32003 күн бұрын
I'll have to try that at some point in the future.
@Muhammed.Abd.7 ай бұрын
At 5:29 why is there so large gap for both like glob went straight from 3.85 to 1.62 and os.walk went from 1.9 to 0.8, like almost half? Then again goes up then again down? I myself had encountered such issues, the python script sometimes take long, then instantly when I run it again is faster
@ekbphd32006 ай бұрын
I don't know why there is such a difference from one run to the next. Any one else know?