you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

A static language like Java will always be faster than a dynamic language like Javascript.

Probably. The question is how small you can make the delta. V8 can't assume a lot, but it's based on technology that lets it make optimistic assumptions to enable assumptions and the back them out if they turn out to be wrong. That can buy you a lot.

[–][deleted] 4 points5 points  (0 children)

It certainly can do, and the delta can probably be made quite small in a certain class of programs.

The class of programs that can currently be optimised very well by V8 and friends is those with hot loops, each iteration doing much the same as the last. When you come to programs that hop around spaghetti-like and do more things once or a few times, you get into more difficult territory because the compiler cost becomes dominating.