Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 23, 2022 10:44 am GMT

Big O analysis is awesome except when it's not

Asymptotic analysis is a powerful tool, but wield it wisely.

Big O ignores constants, but sometimes the constants matter. If we have a script that takes 5 hours to run, an optimization that divides the runtime by 5 might not affect big O, but it still saves you 4 hours of waiting.

Beware of premature optimization. Sometimes optimizing time or space negatively impacts readability or coding time. For a young startup it might be more important to write code that's easy to ship quickly or easy to understand later, even if this means it's less time and space efficient than it could be.


Original Link: https://dev.to/bellatrix/big-o-analysis-is-awesome-except-when-its-not-3dl2

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To