Measured : Which programming language is fastest?
My question is if anyone here has any experience with simplistic benchmarking and could tell me which things to test for in order to get a simple idea of each language's general performance?
There's more than one right
answer.
For the fastest
contributed programs —
The box plot charts show a visual summary of the data: medians, dispersion, skew.
For a simple program —
The current Ruby mandelbrot multicore programs are 7x faster than this simple Ruby transliteration and the exhaustively-optimised + multicore + vector-instruction C programs are more-like 25x faster than this simple C program.
| source code
| secs
| mem
| gz
|
|
|
| Intel C
| 23.62
| 20,580
| 433
|
|
|
| C gcc #2
| 25.04
| 19,708
| 412
|
|
|
| C gcc
| 26.30
| 19,708
| 433
|
|
|
| Go #2
| 26.67
| 19,808
| 500
|
|
|
| C# .NET
| 27.23
| 32,036
| 493
|
|
|
| Go
| 27.30
| 19,808
| 469
|
|
|
| Java
| 29.28
| 43,792
| 445
|
|
|
| PHP #3
| 127.57
| 19,804
| 418
|
|
|
| PHP #2
| 156.45
| 19,804
| 397
|
|
|
| PHP
| 167.49
| 19,804
| 390
|
|
|
| Java -Xint
| 8 min
| 35,168
| 445
|
|
|
| Ruby #2
| 19 min
| 21,248
| 313
|
|
|
| Ruby
| 20 min
| 20,992
| 341
|
|
|
| Python 3 #3
| 20 min
| 19,660
| 392
|
|
|
| Toit
| 28 min
| 68,992
| 387
|
|
|
| Python 3 #2
| 28 min
| 19,660
| 337
|
|
|
| Python 3
| 56 min
| 19,660
| 380
|
|
|
| Matz's Ruby
| 2h 39 min
| 19,680
| 341
|
|
|
| Matz's Ruby #2
| 3h 06 min
| 19,860
| 313
|
|
|
Transliterations are not necessarily idiomatic
. When the Ruby #2 and Python #2 programs are most idiomatic
they are furthest from identical — are they similar-enough to be comparable for your purposes? (The Python #2 program uses a built-in complex-number type.)
The slightly-moderately-highly-wildly ("I spent two weekends on this") optimised mandelbrot programs are not identical — does that matter for your purposes? And [pdf] As fast as C or As fast as SSE and AVX?
For top search queries —
Side-by-side comparison tables for the most frequent searches.