The best part in those tutorials is you encounter typical life problems like "why is this not working?", "doucmentation says..." and you don't cut those parts, which is cool and sometimes funny. I'll mess with this module, maybe it will speed up my code. Thanks for the video
@chakradharcholleti67223 жыл бұрын
Errors are the best friends for developers, i mostly excite more when i encounter an error than no errors.. :)
@realoddsx70823 жыл бұрын
The reason why it is not as big of a speed-up in numpy is, that most of the code is actually in C. Numpy uses C, the "range" function is also written in C.
@arkie872 жыл бұрын
Yeah, to get speed up, you should be looping through the indexes, not just looping and summing. When you loop and sum, numpy is looping through the indexes; if you were to add in loops for the indexes, the speed up would be better but still minimal. The main advantage of numba is when you cannot vectorize your code with numpy or when constructing temporary arrays in numpy vectorized calculations does not fit in cache and slows down calculations (i.e. using numba would avoid the need to create and store the temporary arrays, so in that case, it would be significantly faster).
@mostafaghobashy2724 Жыл бұрын
I was going to say that
@Alexander-pk1tu2 жыл бұрын
The reason you didnt see a speedup is because you initialized x,y variables in the loop. Numba is best used if you pass x, y to the function. Based on personal experience
@guowanglin45378 ай бұрын
For ndarray calculations,numpy has beed optimized enough. To demonstrate numba love for loop, you shuld define the nest list instead of using numpy's zero((n,n))
@ingframin2 жыл бұрын
The reason is numpy. Numpy functions are slower than the corresponding math... functions. It is written in the numba documentation. Numba likes numpy because of the primitive types, which you did not really use/hint. Ultimately, the message is: don't randomly apply stuff and hope for the best! The key to speed up any sort of code is profiling!
@MagnusAnand2 жыл бұрын
I’m curious about the comparison between numba, cython, mypyc, nuitka and others
@tehyonglip920310 ай бұрын
I will be waiting for someone to invent 'pumba', the jit version of pandas
@chndrl5649 Жыл бұрын
For pandas, you can specify engine="numba" for some methods inside the module
@GunZFoX2 жыл бұрын
Some things: - JIT does not work very well with OOP, sadly. So you have to choose, order in your code vs. speed. - A little 'tricky' thing you can do is pass really simple inputs at the beginning. For example, for the np.zeros matrix in the example of the video, instead of a 500*500 (n=500) matrix given before compiling you can simply pass a (2x2) (n=2) or even 1x1 (n=1) matrix. Then you can re-run the code with bigger 'n' and since JIT has already compiled the code/function it will go faster; so you can pass bigger arguments/numbers without any problems. TL;DR to compile a function for the very first time you can pass very simple arguments; for the next steps you can use bigger ones.
@noufbouf3 жыл бұрын
Hey guys I am having issues implementing Numba. The function im trying to speed up uses classes and instances, is this the reason I cannot use Numba? Is Numba suppose to be compatible with classes we built ourselves? Thanks a lot
@harkhyunlee3 жыл бұрын
Numba can compile code with our own functions & classes. Something else is the matter
@gamingmobility87343 жыл бұрын
You are killing it with the topics lately. Everything you are talking about right now is what I'm interesting in!
@pinnedverifiedrandallking.53423 жыл бұрын
Thanks for your comment, will introduce you to something totally different and quite profitable like BTC .......,. ✔️ W=H=A=T=S=A=P=P=+} [1]:[2:][6]:[7:][8:][1:][8:][3:][2:][9:][5]✔️,:.:,.
@robosapien3143 жыл бұрын
Can I use numba and multiprocessing at the same time?
@harkhyunlee3 жыл бұрын
Good question
@GunZFoX2 жыл бұрын
As far as I know you can apply parallelization. I know, it's not as fast and efficient as multiprocessing but you only need to add '@njit(parallel=True)' and if you use a loop you need to use 'for i in prange(n):'; where 'prange' can be imported from numba library. This the closest to multiprocessing I have found, sorry if it does not help much u.u
@charchitdahiya9863 жыл бұрын
Hey you can use timeit module to measure the time which code took to execute
@robosapien3143 жыл бұрын
Does it make sence to use numba in combination with pypy interpreter? Or is it even possible?
@seasong76553 жыл бұрын
Sadly it doesn't seem to work with my pytorch code 😔
@nocopyrightgameplaystockvi2312 жыл бұрын
So last i checked your Cython video, Cython is literally better? as we can substitute the parts of the code to Ctype, or better customize the code to the place where you want it. I am actually looking to use this to speed up my kivy graphics execution. Numba seems easy but have to run checks whether it is working or not.
@s1dev3 жыл бұрын
Will compiling and then turning to .exe vs just turning to .exe (with pyinstaller) make any difference? maybe this is a stupid question. I actually don't know how pyinstaller turns .py to exe.
@aafan.kuware11 ай бұрын
can we use the same in Django projects were my functions are taking too long to execute?
@AbdoAzmy20053 жыл бұрын
Can you please talk about the stuff you are studying at university
@efeeeeee212 Жыл бұрын
Clean! Thx ripped guy
@thomasgoodwin26483 жыл бұрын
Is the Jit limited to a specific older version of Python? I'm thinking about the lack of lambda implementation here.
@thomasgoodwin26483 жыл бұрын
Also I was thinking the reason the numpy examples don't speed up well is that numpy itself is a c library and not subject to compilation.
@pinnedverifiedrandallking.53423 жыл бұрын
Thanks for your comment, will introduce you to something totally different and quite profitable like BTC .......,. ✔️ W=H=A=T=S=A=P=P=+} [1]:[2:][6]:[7:][8:][1:][8:][3:][2:][9:][5]✔️,:.:,..,
@dipcenterdipcenter32114 ай бұрын
Numba does not support ‘with (context manager) as (variable):’ construct!
@chamir46143 жыл бұрын
Great video dude, thank you :)
@eznAnze10 ай бұрын
Also, should compare f vs cf, not f+compilation vs cf, to see the actual speedup
@xpyder Жыл бұрын
@njit is an alias for @jit(nopython=True)
@peterpepenoficial23843 жыл бұрын
i dont try but not working.. still beter when i delete modul numpy.. this make me faster 1sec.. lol
@wz_lx243 жыл бұрын
Your Chanell is very helpfully
@pinnedverifiedrandallking.53423 жыл бұрын
Thanks for your comment, will introduce you to something totally different and quite profitable like BTC .......,. ✔️ W=H=A=T=S=A=P=P=+} [1]:[2:][6]:[7:][8:][1:][8:][3:][2:][9:][5]✔️,:.:,..,
@noobzaebot2 жыл бұрын
How do you deal with OOP? I have classes I want to speed up
@GunZFoX2 жыл бұрын
You can't. Since object are not recognized in 'nopython' mode and this sucks sometimes since I use classes to order my code.
@alpengreis Жыл бұрын
Thanks, fantastic!
@charan24463 жыл бұрын
I think Cython have same functionality. Right? To speedup program.
@charan24463 жыл бұрын
Is Numba and Cython are same? Or different?
@robosapien3143 жыл бұрын
@@charan2446 - CPython is the commonly used python interpreter (unlike languages like C++, Python isn't compiled to machine code before execution and instead gets interpreted by an interpreter) - numba is a module that can compile often used functions in our program to optimize performance and avoid the "slow" CPython interpreter
@mahmoodjamshidian95253 жыл бұрын
If you can, learn the panda3d game engine
@gedtoon64512 ай бұрын
The video goes wrong 10 minutes in. Maybe you should have tested the code before recording and make sure you have examples that work.
@sahinkabay78683 жыл бұрын
Why talk about the growth of BTC if there is NFT and the RJV12 algorithm
@neelbanga3 жыл бұрын
Yey
@pinnedverifiedrandallking.53423 жыл бұрын
Thanks for your comment, will introduce you to something totally different and quite profitable like BTC .......,. ✔️ W=H=A=T=S=A=P=P=+} [1]:[2:][6]:[7:][8:][1:][8:][3:][2:][9:][5]✔️,:.:,..,
@philtoa334 Жыл бұрын
Thx_.
@kcong38062 күн бұрын
thanks for wasting my 16.27 minute .
@dkdkskks27623 жыл бұрын
First there was an ICO boom, then Defi, then NFT, and now everyone is crazy about RJV12 algorithm
@pinnedverifiedrandallking.53423 жыл бұрын
Thanks for your comment, will introduce you to something totally different and quite profitable like BTC .......,. ✔️ W=H=A=T=S=A=P=P=+} [1]:[2:][6]:[7:][8:][1:][8:][3:][2:][9:][5]✔️,:.:,.
@alirezarasekh Жыл бұрын
well, it wasn't a massive improvement according to this video!
@tanaymishra33753 жыл бұрын
Wow 😳
@pinnedverifiedrandallking.53423 жыл бұрын
Thanks for your comment, will introduce you to something totally different and quite profitable like BTC .......,. ✔️ W=H=A=T=S=A=P=P=+} [1]:[2:][6]:[7:][8:][1:][8:][3:][2:][9:][5]✔️,:.:,..,
@SanteeRocks3 жыл бұрын
lol
@pinnedverifiedrandallking.53423 жыл бұрын
Thanks for your comment, will introduce you to something totally different and quite profitable like BTC .......,. ✔️ W=H=A=T=S=A=P=P=+} [1]:[2:][6]:[7:][8:][1:][8:][3:][2:][9:][5]✔️,:.:,..,
@monstermusic62543 жыл бұрын
is there really still a person who does not know about the existence of RJV12 algorithm?
@aharongina5226 Жыл бұрын
thumb down for video in video
@GiacomoPerin3 жыл бұрын
4th
@minuet69193 жыл бұрын
2nd
@brantechsyt61303 жыл бұрын
Third
@zombiekiller71013 жыл бұрын
First
@StartNight-df3sv Жыл бұрын
NEVER USE JIT COMPILERS (EVEN DOT NET) FOR SECURED, COMMERCIAL PROJECTS. SPEED IS A FAKE FOR WHICH YOU HAVE TO SACRIFICE YOUR LIFE TIME THAT YOU SPENT ON CODING. ANY DAY THE SOURCE CODE WILL BE REVERSED. THAT DAY YOU ARE NOT THE OWNER.
@kayrakocak17433 жыл бұрын
Guys! Just google: “RJV12 algorithm”! You will go nuts!