blog/2023-07-17-rust-or-mojo-ai #35
Replies: 3 comments 10 replies
-
This article shows very well how much handy Mojo could be if it will gain desirable popularity :) |
Beta Was this translation helpful? Give feedback.
-
Very nice blog post. The speedup is amazing!!! I have a few minor suggestions:
you could write the code as
With clamp defined in the Math module
Notice that here for each output element, we are computing the sum of a
So at each iteration, you only need to subtract the element that just went outside your window and then add the one that was just added to your window. The same can be done to your box filter where you need to subtract the column that just went outside your window and add the one that just went into your window --- thus reducing the computation to $2*(2radius-1)$ compared to $(2radius-1)^2$. A more advanced optimization would take advantage of the box filter being separable ... but that goes into that mathy side of things.
|
Beta Was this translation helpful? Give feedback.
-
I think modular should hire more great engineers if you want to speed up this process because mojo have the potential to become the most important programming language in the world if what you claim is right |
Beta Was this translation helpful? Give feedback.
-
blog/2023-07-17-rust-or-mojo-ai
Learning Resources for Mojo 🔥
https://mojodojo.dev/blog/2023-07-17-rust-or-mojo-ai.html
Beta Was this translation helpful? Give feedback.
All reactions