3 ms·
The JIT should very easily be able to guess all the types in a complex mechanical or electrical system, or in discrete optimization. Matrices are fairly consi
by bryanlarsen 14y ago
The JIT should very easily be able to guess all the types in a complex mechanical or electrical system, or in discrete optimization. Matrices are fairly consistently typed.
I don't think that JS would do much worse than "naive C" in such a situation. To do well on these sorts of problems, you need to pull in a library that properly uses the CPU's vector unit or the GPU, no matter whether you're using C or JS.
- pkolaczk 14y agoIf it did whole-program optimization, it theoretically could. But it is probably too costly. You don't have that much time and resources to optimize JIT, as you have doing static compilation. That's why, contrary to common beliefs on static vs dynamic compilation, still static compilers win in most cases, compared to even very mature things like JVM or .NET CLR, even though they have much easier task than JS.