top | item 22712436

(no title)

RookyNumbas | 6 years ago

I like to start by thinking about cache locality and ensuring linear layout. Next focus on one-time, or minimal memory allocation. Then there are a bunch of small, systemic things you need to get right. After that you can start worrying about worst case big O scenarios.

Of course this depends on your language. A c programmer will have a different mental model than a python one.

discuss

order

lonelappde|6 years ago

In Python performance is your last consideration, and that's OK. Most things computers do don't need to be fast. Only the innermost loops run the most do.

SaxonRobber|6 years ago

This is the philosophy that has led to our software becoming slower despite improvements in hardware.

Performance is always important. Especially for consumer applications, where your software will probably need to run alongside many other processes each competing for resources.

why_only_15|6 years ago

i used to think this was true, but theres a lot of stuff recently where there really aren't such hotspots everywhere. when i profile UI stuff for instance there isn't some big obvious hotspot to optimize, the runtime is spread all throughout the app doing random things. if all the regular code you write is just ludicrously slow, you're going to end up with something that's just laggy and without any way to fix it other than rewriting it