Why is Python slow?
Key Takeaways
This video explains why Python is slower compared to other programming languages like C++, Java, and JavaScript
Full Transcript
why python is slow this is the question that comes up from people who have worked with compile languages like java and c plus sometimes people also argue javascript is an interpreter language and still it is faster than python i asked this question to one of the members of python steering council python studying council is a committee of five people who decides the future direction of python language these are the creators of python language and i will quickly summarize what we discuss in that call in this video point number one is when you are saying python is slow are you using right module and right approach for example when you are doing heavy number crunching vector and matrix operation you should be using numpy and pandas here i am going to do a quick demo of comparing numpy performance with plain python list here i have created two big list hundred thousand elements each using plain python list and i am going to now divide this to list element by element so that i get price to earning ratio this gives 8.35 millisecond performance but if you i use numpy for the same thing you see i have created numpy arrays i get 94 microsecond which means numpy is 88 times faster so when it comes to big metrics and operations and vector operations numpy and pandas perform the best and that's the reason they are used heavily in machine learning you see that using numpy speeds of the performance and if you are using python list then it was not a python's problem it was your problem you are not aware about the right approach that you should be using in your program now the reason numpy's and pandas are faster is they underneath execute in c or c plus plus so python just provides a wrapper api you make like one line call underneath you get c plus plus performance and that's the reason um python is used so much in machine learning most of the people who are doing machine learning they use python they don't know don't use javascript or they don't use c plus plus so just think about it machine learning is so much computation intensive if python was slow why would people use it for machine learning point number two is let's take about plain python so if you are writing a program in plain python of course it's gonna be slower than compile languages like java and c plus for obvious reasons python is a high level language it gives you convenience rapid prototyping so to get that benefit you have to compromise on the speed now why javascript being an interpreted language is faster because think about google chrome for example javascript is built into a browser now google as a company wants people to use google chrome so google put so much money in making javascript faster javascript is a language specification they have this um v8 engine va the google chrome runs on a v8 javascript engine which is super fast so google puts tons of money in making that faster because they want people to use google chrome so when big companies like google is putting a lot of money into some language of course you will get performance whereas python yeah people are work putting money into it but no company has a proprietary python product like like google chrome so they contribute little bit so python doesn't get as much funding as javascript having said that there are a force being made to make the plain python performance better and you can listen to that whole conversation i'm going gonna put the link of that conversation with python council member in the video description below but overall if you're using the right set of libraries like numpy's and pandas you'll probably not have complaints about speed sometimes your program is slow is slow because you are not using the right design pattern or you are using some for loop unnecessarily so whenever you you think your program is the first try to analyze if there are any design problems in your code try to fix them then try to use the right set of libraries like numpas and pandas 90 to 95 of the time you will not have a complaint that python is low i hope this video helps with your question if you like this video give it a thumbs up if you have any other question post in the comment below
Original Description
Many times people argue that python is slow compared to C++ or JAVA. They even argue that look at Javascript, it is also an interpreted language and yet python is slower compared to Javascript. I asked this question to python steering council member, Pablo Galindo. This council is a group of 5 people who decide the future direction of python programming language. In this video I will quickly summarize the why python is slow? If you want to watch entire conversation where we discussed other topics as well than watch this video,
Entire conversation: https://youtu.be/b23kMqp2M7A
Part where we discussed python speed: https://youtu.be/b23kMqp2M7A?t=2022
Numpy as python list speed comparison code: https://github.com/codebasics/py/blob/master/numpy/numpy_vs_list_speed_comparison.ipynb
Do you want to learn technology from me? Check https://codebasics.io/ for my affordable video courses.
🌎 Website: https://www.codebasics.io/
🎥 Codebasics Hindi channel: https://www.youtube.com/channel/UCTmFBhuhMibVoSfYom1uXEg
#️⃣ Social Media #️⃣
🔗 Discord: https://discord.gg/r42Kbuk
📸 Instagram: https://www.instagram.com/codebasicshub/
🔊 Facebook: https://www.facebook.com/codebasicshub
📱 Twitter: https://twitter.com/codebasicshub
📝 Linkedin (Personal): https://www.linkedin.com/in/dhavalsays/
📝 Linkedin (Codebasics): https://www.linkedin.com/company/codebasics/
❗❗ DISCLAIMER: All opinions expressed in this video are of my own and not that of my employers'.
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from codebasics · codebasics · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Python Tutorial - 1. Install python on windows
codebasics
Python Tutorial - 2. Variables
codebasics
Python Tutorial - 3. Numbers
codebasics
Python Tutorial - 4. Strings
codebasics
Python Tutorial - 5. Lists
codebasics
Python Tutorial - 6. Install PyCharm on Windows
codebasics
PyCharm Tutorial - 7. Debug python code using PyCharm
codebasics
Python Tutorial - 8. If Statement
codebasics
Python Tutorial - 9. For loop
codebasics
Python Tutorial - 10. Functions
codebasics
Python Tutorial - 11. Dictionaries and Tuples
codebasics
Python Tutorial - 12. Modules
codebasics
Python Tutorial - 13. Reading/Writing Files
codebasics
How to install Julia on Windows
codebasics
Python Tutorial - 14. Working With JSON
codebasics
Julia Tutorial - 1. Variables
codebasics
Julia Tutorial - 2. Numbers
codebasics
Python Tutorial - 15. if __name__ == "__main__"
codebasics
Julia Tutorial - Why Should I Learn Julia Programming Language
codebasics
Python Tutorial - 16. Exception Handling
codebasics
Julia Tutorial - 3. Complex and Rational Numbers
codebasics
Julia Tutorial - 4. Strings
codebasics
Python Tutorial - 17. Class and Objects
codebasics
Julia Tutorial - 5. Functions
codebasics
Julia Tutorial - 6. If Statement and Ternary Operator
codebasics
Julia Tutorial - 7. For While Loop
codebasics
Python Tutorial - 18. Inheritance
codebasics
Julia Tutorial - 8. begin and (;) Compound Expressions
codebasics
Python Tutorial - 12.1 - Install Python Module (using pip)
codebasics
Julia Tutorial - 9. Tasks (a.k.a. Generators or Coroutines)
codebasics
Julia Tutorial - 10. Exception Handling
codebasics
Python Tutorial - 19. Multiple Inheritance
codebasics
Python Tutorial - 20. Raise Exception And Finally
codebasics
Python Tutorial - 21. Iterators
codebasics
Python Tutorial - 22. Generators
codebasics
Python Tutorial - 23. List Set Dict Comprehensions
codebasics
Python Tutorial - 24. Sets and Frozen Sets
codebasics
Python Tutorial - 25. Command line argument processing using argparse
codebasics
Debugging Tips - What is bug and debugging?
codebasics
Debugging Tips - Conditional Breakpoint
codebasics
Debugging Tips - Watches and Call Stack
codebasics
Python Tutorial - 26. Multithreading - Introduction
codebasics
Git Tutorial 3: How To Install Git
codebasics
Git Tutorial 1: What is git / What is version control system?
codebasics
Git Tutorial 2 : What is Github? | github tutorial
codebasics
Git Tutorial 4: Basic Commands: add, commit, push
codebasics
Git Tutorial 5: Undoing/Reverting/Resetting code changes
codebasics
Git Tutorial 6: Branches (Create, Merge, Delete a branch)
codebasics
Git Github Tutorial 10: What is Pull Request?
codebasics
Git Tutorial 7: What is HEAD?
codebasics
Git Tutorial 9: Diff and Merge using meld
codebasics
Difference between Multiprocessing and Multithreading
codebasics
Python Tutorial - 27. Multiprocessing Introduction
codebasics
Python Tutorial - 28. Sharing Data Between Processes Using Array and Value
codebasics
Git Tutorial 8 - .gitignore file
codebasics
Python Tutorial - 29. Sharing Data Between Processes Using Multiprocessing Queue
codebasics
Python Tutorial - 30. Multiprocessing Lock
codebasics
Python Tutorial - 31. Multiprocessing Pool (Map Reduce)
codebasics
What is code?
codebasics
Python unit testing - pytest introduction
codebasics
Related Reads
📰
📰
📰
📰
Your Vibe Code Has No Memory. DESIGN.md Fixes That.
Dev.to AI
From Pixel-Pushing to Full-Stack Closed Loop: The Future of Frontend & Designer Collaboration
Dev.to AI
the vibe-coded portfolio / how to build one, 20+ examples, tips + tricks
Medium · UX Design
You’ve decided to become a product designer in 2026. What comes next?
Medium · UX Design
🎓
Tutor Explanation
DeepCamp AI