5 ms·
When I read about these sort of hacks to get performant JS code, it reminds me of how things used to be thirty years ago. Sacrifice code readability to get a s
by BudVVeezer 16y ago
When I read about these sort of hacks to get performant JS code, it reminds me of how things used to be thirty years ago. Sacrifice code readability to get a speed increase because of poor tools...
- robin_reala 16y agoIf you look at the comments you’ll see some test results. The slowest result was 38ms / 100,000 iterations. Even if you looked at that result on a mobile device it still wouldn’t be what you’d call unperformant. In other words, this is micro-optimisation at a pointless level.
- BudVVeezer 16y agoI don't disagree with your point. I was speaking more towards the general trend. It seems like I see one of these articles every week or so.
- Spikefu 16y agoNot necessarily. I just finished optimizing an AES implementation where some of the functions are called hundreds of thousands of times when decrypting a 300k payload. In cases like that, micro-optimization is not at all pointless unless you forget to benchmark the whole thing for each version and compare.
- axod 16y agoOn my Chrome: Math.floor = 2224ms for 100,000,000 iterations 0| = 302ms for 100,000,000 iterations. So in terms of performace, the difference is moot. If you want hacky non readable code that sometimes works, use 0|