Turing speed
From APIDesign
(→The Real Speed) |
(→One VM to Rule them All!) |
||
(2 intermediate revisions not shown.) | |||
Line 5: | Line 5: | ||
On the other hand, each programming language shall be [[Turing complete]] (e.g. support general programming with '''if''', '''while''', '''for''' statements). Thus I propose to compare speed of [[language]]s on so called [[Turing speed]]: ''measure how fast the [[language]] can be when performing a generic computation'' (preferably without any intrinsic built-ins). | On the other hand, each programming language shall be [[Turing complete]] (e.g. support general programming with '''if''', '''while''', '''for''' statements). Thus I propose to compare speed of [[language]]s on so called [[Turing speed]]: ''measure how fast the [[language]] can be when performing a generic computation'' (preferably without any intrinsic built-ins). | ||
- | I am running such experiment with my [[polyglot]] [[Sieve of Eratosthenes] | + | I am running such experiment with my [[polyglot]] [[Sieve of Eratosthenes]] - I am trying to implement simple, long running algorithm in many different [[language]]s and compare their speed. See my [https://github.com/jtulach/sieve/ sieve project] for the actual results. |
- | + | ||
- | As far as I can tell we are on the right track, as our | + | == One VM to Rule them All! == |
- | Default R is probably slower than Python when it comes to Turing speed, but with | + | |
+ | In addition to that I am helping with [[OracleLabs]]’ Graal/[[Truffle]] project that aims to implement the fastest virtual machine on the Planet. The project offers implementations of various [[language]]s with boosted performance: [[Ruby]], [[R]], [[Python]], [[JavaScript]], etc. with the vision to make them all really fast from the point of [[Turing speed]]. | ||
+ | |||
+ | As far as I can tell we are on the right track, as our [[Ruby]] implementation is [[RubySpeed|ten times faster than any other]] implementation. Other [[language]] implementations ([[FastR]], [[Python]], etc.) are on par with such speed. | ||
+ | |||
+ | Default [[R]] is probably slower than [[Python]] when it comes to [[Turing speed]], but with [[OracleLabs]]’ [[GraalVM]] it is no longer true - both the [[language]]s become as fast as native code can be! |
Current revision
Measuring speed of a language is a biased task. Every language comes with certain built-ins suitable for tasks the language is optimized for. Authors of the language usually spend enormous amount of time to optimize these parts and thus comparing languages on their (different) built-ins makes little sense.
The Real Speed
On the other hand, each programming language shall be Turing complete (e.g. support general programming with if, while, for statements). Thus I propose to compare speed of languages on so called Turing speed: measure how fast the language can be when performing a generic computation (preferably without any intrinsic built-ins).
I am running such experiment with my polyglot Sieve of Eratosthenes - I am trying to implement simple, long running algorithm in many different languages and compare their speed. See my sieve project for the actual results.
One VM to Rule them All!
In addition to that I am helping with OracleLabs’ Graal/Truffle project that aims to implement the fastest virtual machine on the Planet. The project offers implementations of various languages with boosted performance: Ruby, R, Python, JavaScript, etc. with the vision to make them all really fast from the point of Turing speed.
As far as I can tell we are on the right track, as our Ruby implementation is ten times faster than any other implementation. Other language implementations (FastR, Python, etc.) are on par with such speed.
Default R is probably slower than Python when it comes to Turing speed, but with OracleLabs’ GraalVM it is no longer true - both the languages become as fast as native code can be!