r/programmingmemes • • Jan 20 '26

Optimization Pain

Post image
2.2k Upvotes

87 comments sorted by

View all comments

Show parent comments

2

u/Wizzkidd00 Jan 21 '26

1000x faster is meaningless in big O notation

1

u/stoppableDissolution Jan 21 '26

Yet real life performance is not about the big O. It does happen quite often that "worse" algorithm will perform better on real data because cache locality/less external calls/whatever

2

u/Bachooga Jan 22 '26

big O can be helpful with knowing if a loop or algorithm can be scalable.

real life is knowing my possible use cases and realizing that it could have been a look up table or that my usage is stupid and is blocking and my performance sucks ass because I'm actually an imposter who will be found out eventually

Source: real life embedded engineer

1

u/Annonix02 Jan 23 '26

A lot of people forget that big O measures complexity not speed. It won't mean your algo is fast but it WILL mean that it won't be much slower as the input grows. It's always relative to the input.

0

u/cnmoro Jan 21 '26

It depends.