Introduction
Here we provide results of performance tests of new Unigine v0.32 bytecode compiler.
We had compared GLSH (Unigine-based application) with PERL, Python and Lua.
Hardware
Tests were performed at AMD and Intel platforms under Linux 2.6 (GCC 3.3.5, optimization flags: -fomit-frame-pointer -march=i686 -O3).
Intel-based PC: Intel Pentium 4 2,8 GHz (800 MHz FSB) / 1024 Mb / Intel BLKD915PSYL (i915P)
AMD-based PC: AMD Barton 2500+ / 512 Mb / ASUS A7N8X-VM/400 (nForce2)
Results
Full tests archive could be downloaded
here (212 Kb).
All of the tests were performed 3 times (to minimize errors), average values of execution times (in seconds) are shown in diagrams (lower values are better).
Diagrams legend:
Array elements access
Simple math operations and array elements access (1000000 iterations)
 |
 |
| Intel |
AMD |
Fibbonachi numbers
Recursive Fibbonachi numbers generator fib(32)
 |
 |
| Intel |
AMD |
Loop
Loop with variable inrement inside (10000000 iterations)
 |
 |
| Intel |
AMD |
Nested loops
Six nested loops with 16 iterations per each loop, variable increment inside
 |
 |
| Intel |
AMD |
Matrix multiplication
128x128 matrix multiplication
 |
 |
| Intel |
AMD |
Optimizator
Loop with simple math redundant expression inside (1000000 iterations)
 |
 |
| Intel |
AMD |
Vectors math
Simple math for 3D vectors (500000 iterations)
 |
 |
| Intel |
AMD |
3D vectors normalization
Normalization of 100000 3D vectors
 |
 |
| Intel |
AMD |
3D vectors dot product
Dot product of 100000 3D vectors
 |
 |
| Intel |
AMD |
3D vectors cross product
Cross product of 100000 3D vectors
 |
 |
| Intel |
AMD |
Random numbers generator
Simple random number generator, loop with 20000000 iterations and function call
 |
 |
| Intel |
AMD |
Gaussian distribution
Simple Gaussian random number generator and calculation of Gaussian distribution
 |
 |
| Intel |
AMD |
Quick sort
Quick sort algorithm of 1980 elements array (no external C functions, pure bytecode).
Bigger array causes stack overflow in qsort for python
 |
 |
| Intel |
AMD |
Bubble sort
Bubble sort algorithm of 1980 elements array
 |
 |
| Intel |
AMD |
Diagrams legend:
Conclusion
Performance of Unigine bytecode compiler is comparable with PERL at common tasks.
Python looks like an outsider in these tests.
Lua has better performance at simple tasks (it can be caused by the fact that list of built-in types is very short for this language).
Unigine bytecode compiler is especially optimized for game development and similar 3D applications - thus, it has built-in data types for vector and matrix operations.
Therefore Unigine bytecode compiler has decided superiority in such tasks as sorting and vectors/matrixes manipulations.
There should be mentioned another advantage of Unigine scripts - they have C/C++ like syntax.
Therefore you can prototype something using Unigine bytecode compiler and then obtain great speed increase by compiling this code, if necessary.
Moreover, there are a lot of good C/C++ developers who can start building their own Unigine-based applications without learning a new language for scripting.