Zip Vs Range - Which is Faster? Benchmarking YOUR code suggestions too!

Zip Vs Range - Which is Faster? Benchmarking YOUR code suggestions too!

14.056 Lượt nghe
Zip Vs Range - Which is Faster? Benchmarking YOUR code suggestions too!
In my recent Dictionary Comprehension tutorial, I've asked you which of the two approaches you think is faster - zip or range? today we will empirically measure the speed of both algorithms within for loops and within comprehensions. In addition, I've collected a few of YOUR code examples from the comment section (which is even more exciting to benchmark 😉) Checkout my recent tutorial here for more information: ⭐ Dictionary Comprehension: https://youtu.be/khCzymLy_QE For this stream, I'm borrowing Badger's benchmarking code. You can find it on Github and use it on your own functions 😀: https://gist.github.com/JBraunsmaJr/c79d096626b84517fa29f817da39df58 Originally Badger's code was meant to check whether LIST comprehensions are faster than for loops and under which condition. It came up in the viewer comments of another recent tutorial: ⭐ List Comprehension: https://youtu.be/SNq4C988FjU In other words - this stream will introduce us to advanced concepts of analyzing algorithms and their running time. So it's not about just making things work, but making them work efficiently! 💪💪💪 Also, I figured out what to do with shorts! Will tell you all about it in this stream! See you soon! 😍 🤝 Connect with me 🤝 -------------------------------------- 🔗 Github: https://github.com/mariyasha 🔗 Discord: https://discord.com/invite/wgTTmsWmXA 🔗 LinkedIn: https://ca.linkedin.com/in/mariyasha888 🔗 Twitter: https://twitter.com/mariyasha888 🔗 Blog: https://www.pythonsimplified.org