Conclusion
This lesson summarizes the discussion on problem vectorization.
The last example we’ve been studying is indeed a nice example where it is more important to vectorize the problem rather than to vectorize the code (and too early). In this specific case we were lucky enough to have the work done for us but it won’t be always the case and in such a case, the temptation might be high to vectorize the first solution we’ve found. I hope you’re now convinced it might be a good idea in general to look for alternative solutions once you’ve found one. You’ll (almost) always improve speed by vectorizing your code, but in the process, you may miss huge improvements.
That’s all there is to discuss in Problem Vectorization! In the next lesson we will learn about Custom Vectorization.
Get hands-on with 1200+ tech skills courses.