Daily Dose of Data Science

Share this post

Vectorization Does Not Always Guarantee Better Performance

www.blog.dailydoseofds.com

Vectorization Does Not Always Guarantee Better Performance

Avi Chawla
Nov 26, 2022
2
Share
Share this post

Vectorization Does Not Always Guarantee Better Performance

www.blog.dailydoseofds.com

Vectorization is well-adopted for improving run-time performance. In a nutshell, it lets you operate data in batches instead of processing a single value at a time.

Although vectorization is extremely effective, you should know that it does not always guarantee performance gains. Moreover, vectorization is also associated with memory overheads.

As demonstrated above, the non-vectorized code provides better performance than the vectorized version.

P.S. 𝐚𝐩𝐩𝐥𝐲() is also a for-loop.

Further reading: Here.

Share this post on LinkedIn: Post Link.

Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new and insightful about Python and Data Science every day. Also, get a Free Data Science PDF (250+ pages) with 200+ tips.


I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn.

2
Share
Share this post

Vectorization Does Not Always Guarantee Better Performance

www.blog.dailydoseofds.com
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

© 2023 Avi Chawla
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing