Python vs JavaScript test of the relative performance.
As an example I took basic prime-finding algorithm with N² complexity.
All found primes are stored in a list/array and as the result scripts print the length of the list/array.
I tested a relative speed of code writing, including typos.
And the Python and JavaScript performance.
Python vs JavaScript – side by side comparison
FOLLOW ME:
Telegram:
Twitter:
Facebook:
MY COURSES:
or
#python #javascript #redeyedcoderclub
can you redo this comparision but using the new speed changes of py 3.11 ?
Python :- i am faster 😐
JavaScript :- No, I am faster🙂
Java :- wait , are you sure ?☺
C++ :- yeah sure .😁
Mojo :- Let me in 💀
Python is more memory efficient.
If JavaScript is thus much quicker than Python, then surely JavaScript would be better for data analysis.
node js is blazingly fast
To me Javascript is the best programming language. It runs in the browser, you can build everything from desktop apps to web and mobile apps with it and it is also pretty fast.
Comparing a traditional interpreter with a JIT compiler…
I'm sitting and waiting for js + ffmpeg to split a 30 minute video into 12 parts, and think maybe python would do it faster…
all video about python: im turtle bro…
Yeap, CPython have no JIT (in this version), so… But if you compare Py and JS in more real world scenario with db and async network things – you can't see much difference. Mostly JS faster. But sometimes Py can be faster bc of the best integration with C.
Btw, if you need speed – you use Numpy or PyPy/numba/pypyc or Cython. Or even Java, Go, Rust, C, Fortran, etc 😀
Any one help me to choose my next course about programming, My goal is data analyst and I have knowledge about SQL and now I would like to learn programming language but I am not belong from engineer background so which one is better for me either python or java?
lol you use if else? why not use ternary operations LOL
This is just because Python integers are boundless integers (like BigInteger in Java), while JavaScript numbers are fixed-size floating point numbers. This is the same reason Python 3 is usually slower than Python 2 (which used fixed-size integers when possible).
wow…..
if only you studied ES6 in Javascript before making this dumb video
Awesome video, great channel name
Shu yotube pyhton da yozilganmi?
instead of return put yield in python and see the power of python
Hi. Very dumb programming question probably but how does the function deal with the different return values of the different blocks inside of it (for and if blocks)? If if the if block returns “false”, the for block returns “true” anyway or did I misunderstood something? Thanks.
What is the color theme in this video?
Python 3.11 is 25% faster, python 3.13 will be 5 times faster.. soon we will beat JS 😜
that programming part was like… eh… I'd say made by somene who just wanted python to win… you could write JS version like this:
for (let i = 2; i < n; i++) if (n % i == 0) return false; return true;
or even
for (let i = 2; i < n; i++) if (!(n % i)) return 0; return 1;
it might not look so good, but it's way to make code shorter
Was super excited when first clicked because I thought this would finally show me how to swap each Python syntax to become Javascript syntax. However… OpenAI Codex is somewhat helping me build such an app, held back because the input allowance is far too limited whereas shortening the script keeps breaking it far too much.
I got pynk eye
nvim? not atom?))
Wow. Huge gap between them
I am surprised🦎
Its just python with C implementation under the hood 🙂 Just use pypy in order to achieve best performance in CPU bound operations.