I've compared the performance of Saltarelle-compiler
by Kevin Gadd
This is shown by the following test.
I've converted the Raytracer Demo
featured on the JSIL website to the Saltarelle compiler, with the aim to compare the execution speed of the two versions.
Adapting the code to Saltarelle was easy but not straightforward. Saltarelle was missing some needed System
classes that I had to re-implement, namely Bitmap
. I tried to keep them as similar as possible to the JSIL version so to not affect the result of the test. I also had to write the import code for mersenne.js
lacks the random seed feature).
Result of the test
I ran the test on a four core Athlon AMD processor with Windows 7 and Chrome browser. The result is summarized in the table:
|Script code size (.js)||108 KB||15 MB|
|Average time/pixel||0.006 ms||0.093 ms|
So, on average, Saltarelle is 15 times faster than JSIL. Impressive!
The output script code is also very small-sized with no loading time, while the JSIL version has to download 15 MB of stuff before it can start.
Check by yourself
You can run the above test in your browser:
You can also download the Visual Studio solution
used to build the Saltarelle version.