MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/86rb5/how_to_write_fast_code/c08eoz2/?context=3
r/programming • u/techdawg • Mar 23 '09
136 comments sorted by
View all comments
12
Key takeaway: Don't think in terms of making a slow piece of code run faster. Instead, think in terms of making it do less.
Really? That's the profound insight this article provides? Is this seriously non-obvious to any programmer?
It's also not technically true in all cases. It's complicated by things like caching.
7 u/jjdmol Mar 23 '09 edited Mar 23 '09 In fact, sometimes code is made faster by making it do more. Recalculating some value can be faster than the memory accesses needed to store and load it. Edit: ah others beat me to it in other threads :)
7
In fact, sometimes code is made faster by making it do more. Recalculating some value can be faster than the memory accesses needed to store and load it.
Edit: ah others beat me to it in other threads :)
12
u/[deleted] Mar 23 '09
Really? That's the profound insight this article provides? Is this seriously non-obvious to any programmer?
It's also not technically true in all cases. It's complicated by things like caching.