Open Menu
AllLocalCommunitiesAbout
lotide
AllLocalCommunitiesAbout
Login

Big O vs Hardware: Better Complexity ≠ Better Performance

⁨50⁩ ⁨likes⁩

Submitted ⁨⁨1⁩ ⁨day⁩ ago⁩ by ⁨abhi9u@lemmy.world⁩ to ⁨technology@lemmy.world⁩

https://blog.codingconfessions.com/p/big-o-vs-hardware

source

Comments

Sort:hotnewtop
  • ftbd@feddit.org ⁨6⁩ ⁨hours⁩ ago

    TL;DR: Big-O notation describes asymptotic behavior

    source
  • squaresinger@lemmy.world ⁨23⁩ ⁨hours⁩ ago

    It’s the old galactic algorithm. Imagine an algorithm that takes the age of the universe to compute the result, but it always takes the same time independent of the input. This makes it O(1) complexity.

    Now imagine you want to sort a list with 100 elements. Pretty much any other sorting algorithm, no matter the complexity, will finish much faster than the galactic one from above.

    Complexity matters only when n gets large enough, and in some cases n stays small enough that algorithmic complexity doesn’t matter.

    source
  • phutatorius@lemmy.zip ⁨1⁩ ⁨day⁩ ago

    TL;DR; don’t just count things when a weighted sum is more appropriate.

    source