Why Javascript is 100x Faster than Python

  Рет қаралды 10,201

CoderOne

CoderOne

Күн бұрын

⭐ The first 1,000 people to use this link will get a 1 month free trial of Skillshare: skl.sh/coderone12211 ⭐
If you've been hearing a lot about javascript performing better than Python on the computational side or this is your first time hearing about it. Well in this video we will go into the details of why javascript performance is better than python 90% of the time on different algorithms, problems, and mathematical calculations.
⭐ Timestamps ⭐
00:00 Introduction (Javascript Vs. Python)
00:29 Skillshare Sponsorship
03:55 Simple For loop test
07:25 Increasing Number of loops to the limit
10:53 I/O Benchmark
12:47 Testing Basic HTTP Boot
15:07 Heavy calculations (Recursive)
16:46 Why is it better to use Pypy instead of Python
💻 Benchmark Repo on Github
github.com/ipenywis/notion-ne...
🧭 Watch Tutorial on Designing the website on Figma
• I Design a onecolor We...
🧭 Watch Create a Modern React Login/Register Form with smooth Animations
• Create a Modern React ...
🧭 Debug React Apps Like a Pro | Master Debugging from Zero to Hero with Chrome DevTools
• Debug React Apps Like ...
🧭 Master React Like Pro w/ Redux, Typescript, and GraphQL | Beginner to Advanced in React
• Master React Like Pro ...
🧭 Learn Redux For Beginners | React Redux from Zero To Hero build a real-world app
• Debug React Apps Like ...
🧭 Build Login/Register API Server w/ Authentication | JWT Express AUTH using Passport.JS and Sequelize
• Build Login/Register A...
🧭 Introduction to GraphQL with Apollo and React
• Introduction to GraphQ...
🐦 Follow me on Twitter: / ipenywis
💻 Github Profile: github.com/ipenywis
Made with 💗 by Coderone

Пікірлер: 41
@DIN_A8
@DIN_A8 2 жыл бұрын
I am learning both at the moment. I am 39 yrs old and do a re-education. Django with a JS library is a pretty powerful combination.
@eminqasimov3398
@eminqasimov3398 2 жыл бұрын
I like your benchmark type of videos. pls make benchmark comparison about popular server frameworks - laravel, django, exress, fastfy, go......etc
@vitorhmtts
@vitorhmtts 2 жыл бұрын
hyperfine can bench multiple commands and show the diference between them, like `hyperfine 'command 1' 'command 2' 'command 3'`. you should've used it that way.
@exhopt
@exhopt Жыл бұрын
I’d be interested to see the results with bun or deno. Not sure if it would make any difference for the demonstrated applications
@justsample9185
@justsample9185 2 жыл бұрын
couldn't find the answer for the title "Why Javascript is 100x Faster than Python".. just running some tests
@kusumasandi
@kusumasandi 2 жыл бұрын
just because javascript using jit to compile bytecode into binary and python using interpreated compiler, javascript also faster for multiple io because it anynchronous by default
@diegocascavita
@diegocascavita Жыл бұрын
That's the benchmark that i was waiting thanks u !
@Ahamshep
@Ahamshep Жыл бұрын
I wonder how much of this speed difference is just due to caching. With the cache decorator mCoding does 400 fib loops in seemingly milliseconds. kzbin.info/www/bejne/ep-uqX58jadnhLM
@ThankYouESM
@ThankYouESM Жыл бұрын
I'm trying to code a basic enough Python -To-JavaScript for generating 3D graphics mainly for creating smartphone games.
@FenoDat
@FenoDat Жыл бұрын
Bruh just use a game engine like unity. Neither python nor javascript are meant to create 3D games since they're extremely slow compared to languages like C# ou C++ that are comonly used in game engines.
@ThankYouESM
@ThankYouESM Жыл бұрын
@@FenoDat I've already made a few awesome games with a Python-To-JavaScript Game Engine a friend helped develop over 15 years ago, but... I no longer have the access to his server to compile it since the year after he died in a fatal car accident. Had told me it only took a month for 3 of them to complete that project. I tried Unity, but... it was far too limiting by comparison on account of not being able to implement my own code as I did with the Py-To-JS-GE. I'm not aiming for realism... just enough to make it look pleasant enough at 2MB maximum. I want all of mine to be HTML5 simply for the compatibility, therefore... C# and C++ are absolutely out of the question, thanks anyway.
@joshgoebel4913
@joshgoebel4913 2 жыл бұрын
This is hardly fair (simple loops). Your using an iterator on Python and just a plain number on JS. This is comparing apples to oranges.
@maxwelljohnson7358
@maxwelljohnson7358 Жыл бұрын
cringe clickbait, i say as im a node TS dev -that actually understands python
@monsieuralexandergulbu3678
@monsieuralexandergulbu3678 2 жыл бұрын
It's not fair to first show the slow vs fast and then switch.. If you're using the best performance implementation of JavaScript, then why you're not using the best performance implementation of python from the start? (pypy/cython/numba and not cpython as your showed)
@FlanPoirot
@FlanPoirot Жыл бұрын
no, it is fair V8 is the implementation used by almost everyone, even the firefox implementation is very fast. the official python implementation is pretty slow, it's also the most used implementation and is what's installed by default on all linux distros. people only really use those other implementations when they're looking for ways to improve execution speed in production level code, most won't. even then, V8 is still faster than pypy if you're curious about that
@DommageCollateral
@DommageCollateral Жыл бұрын
clickbait doesnt work for devs bro
@mgr1282
@mgr1282 2 жыл бұрын
Python with numba, pypy, numpy, ... is fast.
@maxwellflitton3973
@maxwellflitton3973 Жыл бұрын
yes.... and that's because the libraries you've mentioned exploit C code to get that speed.
@mgr1282
@mgr1282 Жыл бұрын
@@maxwellflitton3973 That's true & It was not a secret.
@mgr1282
@mgr1282 Жыл бұрын
@@maxwellflitton3973 I think PyPy & Numba use a jit compiler to run faster.
@maxwellflitton3973
@maxwellflitton3973 Жыл бұрын
@@mgr1282 yes it's not a secret ...... but it's also not a testament to the python language. It's a testament to the C language then isn't it. Plus numba, pypy, numpy are limited in scope. I doubt you could increase the efficiency of threads managing connections on a server with those libraries. Having coded in Numba PyPy etc, they're limited. They're definitely not a substitute for an entire language. You can't even append on a list in numba. You raising these packages has zero effect on the discourse of the subject
@ibrahimshehuibrahim918
@ibrahimshehuibrahim918 2 жыл бұрын
lmao 100 times
@xoldyckk176
@xoldyckk176 2 жыл бұрын
Try benchmarking v8 vs pypy.
@CaptainLoony
@CaptainLoony 2 жыл бұрын
What's the difference? Didn't he just do that?
@mrbigberd
@mrbigberd 4 ай бұрын
@@CaptainLoony He benched vs Cpython and Pypy. Pypy is much faster, but not generally as fast as JS and it sees almost no use because it's incompatible with so many libraries (because they are written in C/C++).
@_chiku11
@_chiku11 2 жыл бұрын
But I love Python 💗💗💗💗
@AnglephileSwedenGerman
@AnglephileSwedenGerman 11 ай бұрын
Lol a yr later+
@catayyyy
@catayyyy 2 жыл бұрын
Have fun using JavaScript while coding a self driving car algorithm. Hope you get the point.
@dinoscheidt
@dinoscheidt 2 жыл бұрын
Your not using python, but C++ libraries that you call via python. If python would be responsible for self driving cars algorithms, they today wouldn’t be able to turn on the blinker. Python is an easy to lern domain language without types and is absolutely synchronous that uses many C++ libraries. Great for people that need to automate data processing and don’t know software engineering. Bad news for people that believe this is software engineering.
@coertzenjfs
@coertzenjfs Жыл бұрын
I could do that...
@catayyyy
@catayyyy Жыл бұрын
Lol, you guys didn't get the point :) I didn't suggest anything to build a self driving car. "JavaScript is 100x faster" on what terms ? Get it ? He should have said for example "JavaScript is 100x faster when it comes to calculation basic arithmetic operations than python" maybe. E.g. "Php is better than java", "Python is the best language", "Java has not enough open source libraries"...
@UncleDavid
@UncleDavid Жыл бұрын
@@catayyyy ur talking to a wall lol
@marvin.toyboy
@marvin.toyboy Жыл бұрын
​@@catayyyy fact is that Javascript is always faster and have far less consumption. So we all don't give a single flying f*
@DommageCollateral
@DommageCollateral Жыл бұрын
JAVASCRIPT CANT BE EXECUTED FROM THE GPU!!! HOW CAN JS BE FASTER THAN PYTHON???!!
@marvin.toyboy
@marvin.toyboy Жыл бұрын
1/ We can use Javascript langage for GPUs 2/ It's faster than Python 3/ Your statement is just pointing to the fact that the GPU are faster than the CPU (and it's not for all tasks), not Python. Python consume far more energy and is slower than JS, running it into a different electronic component such as a GPU doesn't mean that Python itself is faster than JS. You guys using Python don't understand what is a "benchmark" because you are like all those sheep who heard the name of "python" and who have been so much impressed by the name (of a dangerous animal) that they choosed it because of his name and popularity but nothing else, it's pretty obvious and dumb. Thanksfully we have now people using their brain and making AI libraries for NodeJS. (not everybody is using Python for his name and popularity but most people clearly do, they have no clue (like you) what is a benchmark)
@sar_amd_7771
@sar_amd_7771 10 ай бұрын
Where's it written that JavaScript can't run on gpu lol😅
@DommageCollateral
@DommageCollateral 10 ай бұрын
@@sar_amd_7771 besides that you also have to pass the data using sharedmemory and it takes a lot of preperation to do this. you have to use the correct nativearrays (associative arrays) and BufferAttribute and strides. so its gonna be hard to pass strings to the gpu if you use webgl
@DommageCollateral
@DommageCollateral 10 ай бұрын
dont know where the other answer has gone but: theres a new package released by nvidia, but im not sure how well its implemented besides that you can only use webgl
@YTChannel344
@YTChannel344 8 ай бұрын
@@DommageCollateralIt can be used with GPU otherwise there would be no point for canvas based GPU accessible HTML5 games or other game engines leveraging it for web games.
JavaScript vs Python: What's the Difference?
11:11
ArjanCodes
Рет қаралды 28 М.
Is TypeScript (NodeJS) Faster than Go?? |  A server comparison
9:54
ThePrimeagen
Рет қаралды 211 М.
How many pencils can hold me up?
00:40
A4
Рет қаралды 18 МЛН
PYTHON vs JAVASCRIPT // What I Would Choose as a Beginner…
12:48
Internet Made Coder
Рет қаралды 320 М.
Python Speed Comparison: Faster Than We Thought?!
23:51
NeuralNine
Рет қаралды 18 М.
[UPDATE] Mojo Is Faster Than Rust - Mojo Explains More
52:09
ThePrimeTime
Рет қаралды 230 М.
PROOF JavaScript is a Multi-Threaded language
8:21
Beyond Fireship
Рет қаралды 260 М.
Why I avoid useEffect For API Calls and use React Query instead
17:45
Microsoft FINALLY killed it
6:45
Alex Ziskind
Рет қаралды 542 М.
Why I Moved from RESTFUL APIs to tRPC instead in React
12:52
CoderOne
Рет қаралды 53 М.
Rust makes you feel like a GENIUS
10:48
No Boilerplate
Рет қаралды 398 М.
PYTHON vs JAVASCRIPT - Which one should you choose?!
8:59
Full Stack MD
Рет қаралды 18 М.