Make Python code 1000x Faster with Numba

preview_player
Показать описание
In this video I introduce Numba which can make your python code 1000x faster. Numba is a just in time compiler for a subset of Python and Numpy. The first half of the video is dedicated to a basic intro and to highlighting a number of very common mistakes people make when using Numba. The remaining video show how to use Numba in a real world-ish simulation problem and shows the code running 1000x faster with Numba in both single and multithreaded cases, and concludes with a "reading list" for learning more about Numba.

MY OTHER VIDOES:

Deeper topics to discover here

Supported python and numpy features

Easily put your computation on a GPU!

#numba #programming #python
Рекомендации по теме
Комментарии
Автор

finally, my print("hello world") can run at the speed of light!

gdsvsrv
Автор

Amazing, amazing video. As a PhD student, I'm sure you've saved me much more than 8 hrs of compute.

MichaelKudlatheInterested
Автор

Seriously this is brilliant.

By applying this to the 3 main functions of a 1500 lines project I went from a 24 minutes runtime to about 20 seconds. that's 70X faster for a day's work (it'd be faster now that I learned the more complicated details). The C++ equivalent of the code does it in about 15 seconds.

klioseth
Автор

One thing to note is that Numba really optimizes nested loops. If you say have to call a function a 100 or million times, better to have an outerloop instead that iterates within the function. With parallel turned on, you can see a 1000x increase.

tronali
Автор

I nod my head with approving noises as if I understand what is going on.

id
Автор

Similar to other commenters, I have to say this is one of the best YouTube tutorials on writing fast Python code. Great buildup to the mic drop moment, amazing progression. Jack, I hope you make it big in the CS-tutorials YouTube space and have a great day.

kaandonbekci
Автор

Numba really is great. Here is my first experience with it: I have some code that I estimated would take up to half a year to run. With some minor changes to the code for compatibility with Numba, the run time for the same conditions was up to 1.5 hours. This was a game-changer for me as I needed to run this script many times.
One of my colleagues also implemented it into his machine learning code and managed to obtain some significant speed bumps.

ger
Автор

Finally, this is what Python has needed

irok
Автор

One of the most awesome Python tutorials I have seen. The narratives, the examples and the way you explain it is just awesome, 5 starts to you man! keep on doing it!

jmnunezd
Автор

This is one of the best programming-related video tutorials I've ever seen. No-nonsense style, very direct and still computationally rigorous. Awesome stuff!

valente.victor
Автор

I implemented it in my code, and it took around an hour worth of computation and put it down to 30 seconds. Amazing stuff.

joshuatyler
Автор

11:45 - try this: np.zeros_like(input_list, dtype = np.int64, order='C')
My experience with numba - it works great, but types have to be very precisely defined for every single object. Otherwise nopython will fail, and where numba sucks is generating traceback messages - in the case of complex functions it will take forever to debug. So type whatever you can - it is not a 'Pythonic' way of thinking and writing, but in this particular case it is necessary. Anyway, great introduction!

frodobaggins
Автор

I am in tears to see my code run so fast, thank you so much for this video

saurabhpareek
Автор

What an amazing video. I'm a student in Computer Science and we just did a week ago an introduction to Numba.
And you sir not only explained to me the concepts in a positive astonishing way, but also gave me the desire and the excitement to apply it on all my old and future codes. Thanks you !
PS : Is there more videos where you're explaining the others topics ( convolution, neural networks .. )

MisterFresh
Автор

These are some seriously impressive results. I wonder if this could give Python a niche in indie game development.

SomeFreakingCactus
Автор

Damnit, why did I only discover this 6 days before my PhD submission deadline?!

jongmassey
Автор

I cannot thank you enough for this video. I made a simulation of Gray Scott's Reaction diffusion in python, but it was painstakingly slow. After using numba, it now runs quite fast. Earlier it took nearly about 1 hour to render just 100 frames at a mere 400x400 resolution, now it renders 100 frames in 45 seconds, in 1280x720 resolution. Thank you very much for this video.

preyasurakshit
Автор

There’s no way this delivers as promised. I’m about to implement it and will update soon.

brockobama
Автор

I bet my friend who called Python a "fake language" is soiling himself right now.

IndellableHatesHandles
Автор

YES, I LOVE PYTHON AND THIS IS PERFECT THANK YOU MATE

RealLionTion
visit shbcf.ru