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
| 20,020
| 500
|
|
|
| Go
| 27.65
| 20,052
| 469
|
|
|
| Java
| 29.28
| 43,792
| 445
|
|
|
| C# .NET
| 46.88
| 31,916
| 472
|
|
|
| PHP #3
| 128.59
| 19,656
| 418
|
|
|
| PHP #2
| 156.85
| 19,656
| 397
|
|
|
| PHP
| 168.78
| 19,656
| 390
|
|
|
| Java -Xint
| 8 min
| 35,168
| 445
|
|
|
| Ruby #2
| 19 min
| 21,376
| 313
|
|
|
| Ruby
| 20 min
| 21,248
| 341
|
|
|
| Python 3 #3
| 20 min
| 19,660
| 392
|
|
|
| Toit
| 27 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.
For other programming languages —
Maybe legacy languages. Maybe alpha languages. Maybe less popular languages. Languages that are different.
Answers & Questions, Criticism & Response —