You can optimize the python code by setting count to 200000000 before the loop :)
@BekBrace8 ай бұрын
cool, a valid optimization suggestion but I don't think it will drastically change anything :)
@meqdaddev43418 ай бұрын
Python next feature: Implementing the Python popular packages using Rust with just a Python wrapper 🤣
@BekBrace8 ай бұрын
Nothing is impossible 😂
@BRISKLYHIDDEN7 ай бұрын
😂😂😂
@timothyking37596 ай бұрын
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)
@contentpump25378 ай бұрын
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.
@BekBrace8 ай бұрын
So true (your second part of the statement), I haven't forgotten though, it was deliberately written this way.
@falkez15148 ай бұрын
please post a video to tell us when python is done!
@BekBrace8 ай бұрын
😂😂😂
@BRISKLYHIDDEN7 ай бұрын
😢
@ggsap7 ай бұрын
This test is still taking into account the timing code. Instead use the time command. Also why no optimizations are enabled for rust?
@BekBrace7 ай бұрын
Thanks, I didn't know about optimization till a video later -_-
@vladyslav-py-js-cs8 ай бұрын
It was predictable😂
@BekBrace8 ай бұрын
I want to test Haskell, C and Rust in the next one :)
@vladyslav-py-js-cs8 ай бұрын
@@BekBrace Wanna see it😁 it's gonna be fun
@CosmicSilhouette8 ай бұрын
Since both C and rust are closer to machine than python will the difference in speed be minimal and more unpredictable?
@bekbraceplus8 ай бұрын
Absolutely true, I am doing that test this week, and for more spicy flavor I'll add Haskell to the game ! Stay Tuned!
@jaroslavhuss78137 ай бұрын
Here again, please, use --release flag with Rust... IT would be 0.0000000....
@BekBrace7 ай бұрын
Again, learnt that lately - thank you
@mr.michaelsomeone56678 ай бұрын
Use iterarors instead of "for" cycles in Rust
@BekBrace8 ай бұрын
Thank you, Michael, I will do in the next Test video 👍🙏
@andreasmastronikolis39878 ай бұрын
just checked on my machine with c++ ... 0.05 seconds.
@BekBrace8 ай бұрын
What the .... 😲😲😲
@Maxawa08518 ай бұрын
You sure the compiler didnt just optimize the loop with a count = 200000000?
@oskwon728 ай бұрын
How about vs. Golang or vs. C++?
@BekBrace8 ай бұрын
I guess we'll figure out soon 😉
@lmnts5568 ай бұрын
Try to do it with cython or even numba.
@BekBrace8 ай бұрын
I should
@gustavojoaquin_arch8 ай бұрын
Heil Rust
@BekBrace8 ай бұрын
Hail to Rust 😁
@josephusophia8 ай бұрын
i don't think this comparison is fair especially rust is compiled and python is an interpreted language
@BekBrace8 ай бұрын
No it's not you're right, but just to show the difference 😉 Correction for you: Python is an interpreted language, true, but it's also compiled into bytecode which is done automatically and after execution. But still, doesn't help I know 😂. In the next one, I'll show you rust vs two other languages.
@josephusophia8 ай бұрын
@@BekBrace What about comparing production time over execution time ration When you calculate the time needed to write the code and divide it by the execution time. That would be very interesting
@BekBrace7 ай бұрын
@@josephusophiaI'll do that between Rust, Node, C and Python
@waelmohameddd8 ай бұрын
Please C next video, man
@BekBrace8 ай бұрын
Done
@furiousmilk65598 ай бұрын
what abt c++ and rust?
@BekBrace8 ай бұрын
I have never coded in C++, however I do C and I'll make the next Test with C
@furiousmilk65598 ай бұрын
@@BekBrace nice, I've never tried rust but I could do a quick c++ to compare to your rust code iyw