Schroedingers-Hat/jsphys — comment on commit 2238b8181104def4ea3907cbdfed5330cc71c021
File: relativity/js/README line 2
By capnrefsmmat:

I suspect the Closure compiler is rather limited in what it can do. In JavaScript there's no information on variable types, so the interpreter can't specialize code for, say, adding integers, but instead has to check "Is this a string? Then concatenate them. No? An integer? Add! No? A floating-point value? Add? Some random object? ..."

We'll be helped here by using things like typed arrays and carefully using types so that the JIT compilers used by modern browsers can optimize well. Firefox 9, for example, uses a system to infer the types of variables by seeing how they're used. There are some tricks to give it good information to make its job easier, and we can investigate them eventually.