200M Speed Comparison :: Python Vs Rust | Closer To Machine Code

preview_player
Показать описание
Decided to do this little test on my favorite programming languages: Rust and Python.
Of course, I knew ahead which is faster, but still I was very interested to know the exact duration, and how much time would it take both languages to count to 200 Million.

🔔 Don't forget to:
💬 S U B S C R I B E
🔔 H I T T H E B E L L
👍 L I K E, S H A R E, A N D C O M M E N T

#Subscribe #HitTheBell #LikeShareComment 🚀

Credits for Music:
-----------------------------
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Music promoted by Copyright Free Music - Background Music For Videos 👉
/ @podcastbackgroundmusic
––––––––––––––––––––––––––––––
🔎 WORDS THAT DESCRIBE THE MUSIC 🔎
The Best Copyright Free Music for Your Podcast, where to get free no copyright podcast music, background music no copyright, royalty free music for video - curated library for creators, Podcast Background Music While Talking Interviews, vlog background music while talking upbeat, background music for podcast serious, musica para podcast, Copyright free music, new trending tiktok viral songs 2024, capcut background music | no copyright, interview background music for videos no copyright, no copyright music
Рекомендации по теме
Комментарии
Автор

You can optimize the python code by setting count to before the loop :)

laabiditarek
Автор

Python next feature:
Implementing the Python popular packages using Rust with just a Python wrapper 🤣

MeqdadDev
Автор

please post a video to tell us when python is done!

falkez
Автор

You even forgot to enable Optimizations on the Rust side, so it might be slightly to infinity faster depending on if the rust compiler can tell that the result is always going to be 200_000_000.

contentpump
Автор

rust: 0.70 seconds; matlab: 0.17s seconds
here's the matlab code
count = 0;
startTime = tic;
for i = [1:2*10^8]
count = count +1;
end
toc(startTime)

timothyking
Автор

Since both C and rust are closer to machine than python will the difference in speed be minimal and more unpredictable?

CosmicSilhouette
Автор

This test is still taking into account the timing code. Instead use the time command. Also why no optimizations are enabled for rust?

ggsap
Автор

What about python with numba or a jit compiler?

warrenjohndfs
Автор

Use iterarors instead of "for" cycles in Rust

mr.michaelsomeone
Автор

Here again, please, use --release flag with Rust... IT would be

jaroslavhuss
Автор

just checked on my machine with c++ ... 0.05 seconds.

andreasmastronikolis
Автор

Try to do it with cython or even numba.

lmnts
Автор

This is not fair .. where is Mojo🔥?!!!

cloudcoder
Автор

i don't think this comparison is fair especially rust is compiled and python is an interpreted language

josephusophia