Benchmarks
 previous   up   next 

It is hard to create benchmarks to compare programming languages in a fair way. To accomplish this it is necessary to use the same algorithm and the same abstraction level for one test. This leads to strict rules: Inline assembly or other inline code must not be used. The usage of vector instructions, GPU computations and multiple threads is only allowed if the benchmark story explicitely allows it. Furthermore the standard libraries of the language should be used (not libraries from somewhere in the internet).

The benchmark programs below use statements and expressions but also standard library functions. These include container functions, sine, or the random number generator. The standard library functions usually come with the language, so they can be viewed as part of the language. Programmers will usually use these library functions. So it is a realistic approach to measure them as well.

  1. Eratosthenes
    PlaceLanguageReal time
    1Seed70m0.037s
    C++0m0.037s
    3Java0m0.151s
    4JavaScript0m0.209s
    5Python 30m1.183s
  2. Monte Carlo
    PlaceLanguageReal time
    1Seed70m0.223s
    2C++0m0.290s
    3C0m0.431s
    4JavaScript0m0.475s
    5Java0m0.526s
    6Go0m0.608s
    7Ruby0m2.960s
    8Perl0m3.046s
    9Python 20m4.480s

 previous   up   next