doc • benchmark

Benchmarks

Gambas is an interpreted language, with no "just-in-time" or other compilation to native code at all up to the 3.2 version.

Here is some little benchmarks mostly stolen on the Internet used for comparing Gambas and Gambas JIT-compiled with interpreted Python and Perl.

The tests were done on my own computer, by running them with the time system utility. The execution time is the sum of the user time and the system time.

Note there is a little time used for compiling the source files in all languages.

Almost all benchmarks are stupid.

Results

Execution times are measured in seconds.

Benchmark Python Perl Gambas Gambas + JIT
sort 4,30  8,52  5,36  0,43 
polynom 12,47  22,54  9,20  0,60 
primes 5,98  9,49  3,84  0,68 
nbody 6,02  7,77  5,43  0,93 
mandelbrot 6,68  4,96  3,83  0,12 
string 9,42  8,16  6,10  6,11 

Language versions

The following versions of the languages were used:

  • Python 2.7.10.

  • Perl 5.20.2.

  • Gambas 3.8.90 (development version r7476).

Benchmark source code

To get the source code of the benchmarks, browse the benchmark directory in the Gambas source code.

Run the benchmark on your own system

There is a script named benchmark.gbs in the benchmark directory. Just open a terminal, change to that directory, and run it.

You will get the result as HTML data. If you want to share it, don't forget to specify which distribution you run and your CPU model.

For example, on my own system (with 4 cores, hence the four repeated lines):

$ uname -a
Linux benoit-kubuntu 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/cpuinfo | grep "model name"
model name      : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
model name      : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
model name      : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
model name      : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz