2 ms·
Evidently the tricks were what made it slow. This happens all too often: once the code changes enough that the optimizer doesn't recognize the pattern anymore,
by ncmncm 7y ago
Evidently the tricks were what made it slow.
This happens all too often: once the code changes enough that the optimizer doesn't recognize the pattern anymore, it throws up its hands, and you're on your own. Some people call this optimizer roulette.
It's not just compilers, either. CPUs have their own peephole optimizers, and patterns they recognize, or don't, and it can easily make a 2x difference in your run time depending on if it cottons to what you're trying, or doesn't.
- pjmlp 7y agoWith CPUs it gets even worse, because that clever optimized Assembly code can stop being so in another CPU or after a firmware update. The days of Z80, 6502 and similar are long gone.