Factor does not do inline caching (although this is planned), however the language itself is more static and the compiler performs more advanced optimizations than the V8 JIT. So I thought it would be interesting to see how these two approaches to dynamic language implementation stack up.
I compiled the V8 trunk today on my Intel Core 2 Duo. Factor is of course the latest Factor from git.
I chose the following benchmarks from the language shootout:
Unfortunately, I couldn't get reverse-complement or a few others to work in V8, because they use the
readline()function which does not appear to exist. It would have been interesting to compare more benchmarks.
I ran the V8 benchmarks from the command line, like so,
And I ran the Factor benchmarks from within the Factor environment.
Without further ado, and without any attempt at post-mortem or analysis, here are the results. All running times are in seconds: