Talk:Array length: Difference between revisions

no edit summary
(and we could probably cache the length and switch to if then else, too, whenever run-time outweighs coder time)
 
No edit summary
Line 16:
 
Though once we announce the start of the pre-optimisation season, we are probably also inviting someone to pop up and point out, quite correctly, that JS implementations of ternary expressions tend to be less efficient than their implementations of if then else statements :-) [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 16:22, 8 October 2015 (UTC)
 
: Yep. And on a related note Haskell's fold optimizations (where non-used elements aren't fetched at runtime) do have a compile time cost.
 
: And it's also possible that different JS implementations will optimize ternary expression handling. But mostly I don't care about optimizations which yield less than a factor-of-2 improvement - with exceptions to the rule, of course, being in the context of resource-critical bottlenecks. Reason being that quite often there's factor of 1000 (or better) optimizations available if you instead take some time to digest the relevant issues. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 17:21, 8 October 2015 (UTC)
6,951

edits