4 ms·
> Better performance is always a net gain, I think that's easily disputed: it's always a trade-off. A 0.001 ms improvement in performance is a net loss if make
by Vinnl 8y ago
> Better performance is always a net gain,
I think that's easily disputed: it's always a trade-off. A 0.001 ms improvement in performance is a net loss if makes code 10x less readable, because that means programmers are more likely to introduce bugs, which would be a net loss. For example, I one worked with someone who changed all i++'s in a codebase to ++i's, even though they were not in performance-critical codepaths. That was not worth the effort.
- hvidgaard 8y agoI was speaking in the context of two different frameworks, not code, but I suppose the clarification is nessesary. > I one worked with someone who changed all i++'s in a codebase to ++i's Did you use the previous value of i, or did you just intent to increment it? ++i communicate that I'm not interested in the old value, where as i++ does the opposite. I actually use it as such, because my intent to a future reader of the code is more clear. That said, for complex types, and with "stupid" compilers ++i can absolutely be significantly faster.
- Vinnl 8y ago> Did you use the previous value of i, or did you just intent to increment it? ++i communicate that I'm not interested in the old value, where as i++ does the opposite. I actually use it as such, because my intent to a future reader of the code is more clear. I would consider that a valid reason to use ++i. In this case, however, he indicated performance as being the reason. Furthermore, this was for a school assignment demonstrating that we could properly implement a particular algorithm, so the performance difference was absolutely irrelevant.
- MaxBarraclough 8y agoThe poor performance of web technologies (despite the incredible wizardry that's going into our browsers) are a large part of the reason that so much mobile-device interaction fails to run at 60FPS, no? It's 2018, we're all walking about with supercomputers in our pockets, and yet we're putting up with <60FPS UI. The impact of UI performance on user experience is serious enough that Netflix wrote their own rendering engine. https://medium.com/netflix-techblog/crafting-a-high-performance-tv-user-interface-using-react-3350e5a6ad3b https://medium.com/netflix-techblog/crafting-a-high-performa...