4 ms·
It's about some of core principles of software: Keep it simple, use the minimal code (if it's not there, it can't slow you down), see where speed problems are b
by qwertyuiop924 10y ago
It's about some of core principles of software: Keep it simple, use the minimal code (if it's not there, it can't slow you down), see where speed problems are before optimizing, optimize before scaling up.
It's common sense, but it's rare to actually follow it.
Actually, I'm guilty of this myself. I was finishing last year's Advent of Code, and was given a problem which I tried to optimize, as I assumed the naive approach would be too slow. Then I realized I was trying to optimize Travelling Salesman, so I bit the bullet and went for the O(n!) solution. And it ran in less than a second. In interpreted scheme, no less.
I felt kind of silly later.