Python glob vs os.walk

  Рет қаралды 133

EKB PhD

EKB PhD

8 ай бұрын

I test whether glob() or os.walk() is faster in Python when trying to find files in subdirectories on a harddrive.

Пікірлер: 4
@marvinakuffo4096
@marvinakuffo4096 5 күн бұрын
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.
@ekbphd3200
@ekbphd3200 3 күн бұрын
I'll have to try that at some point in the future.
@Muhammed.Abd.
@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
@ekbphd3200
@ekbphd3200 6 ай бұрын
I don't know why there is such a difference from one run to the next. Any one else know?
Python is getting faster
7:50
EKB PhD
Рет қаралды 204
Python os.walk() Method
10:11
Koolac
Рет қаралды 5 М.
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 19 МЛН
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 197 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 8 МЛН
Why is Julia slower than Python?
14:29
EKB PhD
Рет қаралды 606
Generative AI in a Nutshell - how to survive and thrive in the age of AI
17:57
How I'd Learn AI (If I Had to Start Over)
15:04
Thu Vu data analytics
Рет қаралды 762 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 264 М.
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 823 М.
Anaconda (Conda) for Python - What & Why?
26:10
Academind
Рет қаралды 224 М.
How to Improve LLMs with RAG (Overview + Python Code)
21:41
Shaw Talebi
Рет қаралды 41 М.
Why is Mojo's dictionary slower (!) than Python's?
12:16
EKB PhD
Рет қаралды 4 М.
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 19 МЛН