3 ms·
If you're, for example, rewriting an obviously correct but slow piece of code X into a faster but not obvious code Y, how do you know if the two are functionall
by gngeal 13y ago
If you're, for example, rewriting an obviously correct but slow piece of code X into a faster but not obvious code Y, how do you know if the two are functionally identical without at least some knowledge of program algebra?
- cunac 13y agoby testing and measuring performance ? In real world it is rare that you have easy way to guess actual overall impact of your optimization. sure you profile and go for hotspots but still it is very hard to actually understand full impact and CS algorithms are done in ideal conditions so they don't address complexity of executing environment and might be misleading path for optimization.
- jiggy2011 13y agoI think the question is how can you be confident that the optimised code does exactly the same thing as the non-optimised code.