7 ms·
Which programming language is fastest?
- jeberle 16y agoAlso notice, time is plotted on a log scale.
- lucisferre 16y agoI once heard a joke related to this: Dev1: "Did you know C# is faster than C?" Dev2: "No, really? By how much?" Dev1: "Oh about 6-12 months"
- signa11 16y agolet's kill all the language lawyers...
- russell 16y ago"No. ... No." Benchmarks are worthless unless they accurately model your application and workload. Is C 42 times faster than Python for doing numerical calculations? No. If you are using NumPy, the difference is more like 10%. (I pulled the 10% figure out of my nether orifice, but I believe it to be in the ballpark.) Yes, I know that NumPy is buckets of C with a tasty Python frosting.
- igouy 16y ago> Benchmarks are worthless unless... There's a page for that! http://shootout.alioth.debian.org/flawed-benchmarks.php#app http://shootout.alioth.debian.org/flawed-benchmarks.php#app > If you are using NumPy... http://shootout.alioth.debian.org/u32/program.php?test=spectralnorm&lang=python&id=2 http://shootout.alioth.debian.org/u32/program.php?test=spect...
- supersillyus 16y agoI don't want the fastest possible language or the most powerful possible language. I want the simplest language that is fast enough and powerful enough. The Benchmarks game is a lot of fun, but if I were making a language (especially one not designed for speed), I probably wouldn't put it up there. It encourages contributors to think "oh crap, if we optimized our X better, we'd be like 4 higher in the listings!" instead of "What sort of useful code can I write?".
- kumarshantanu 16y agoAssembly Language, I guess.
- avar 16y agoYou have to click around to see it, because the default rendering only includes GNU C++, not GNU C.
- giu 16y agoGraph including GNU C: http://shootout.alioth.debian.org/fastest-programming-language.php?calc=chart&gcc=on&gpp=on&ghc=on&java=on&csharp=on&racket=on&sbcl=on&v8=on&hipe=on&lua=on&vw=on&python3=on&yarv=on&php=on&perl=on http://shootout.alioth.debian.org/fastest-programming-langua...
- Synaesthesia 16y agoHow about LLVM C & C++ ?
- igouy 16y agoHere's where you can download the Python measurement scripts so you can make those LLVM measurements and publish them - http://shootout.alioth.debian.org/help.php#languagex http://shootout.alioth.debian.org/help.php#languagex
- berntb 16y agoSeems quite different compared to what I remember previously. Have some communities been updating their interpreters/compilers to optimize for these tests? (Reminds me of the 1990s when Intel built a special machine (which you could theoretically buy, to fulfill the demands) and wrote a special compiler for SPECs... :-)
- igouy 16y ago> Seems quite different compared to what I remember previously. The simple explanation is that you don't remember very well what you saw when you looked previously.
- draegtun 16y agoCould be?... but I suspect its more communities optimising their benchmark programs. See footnote: Which programming language is fastest? No. Which programming language implementation has the fastest benchmark programs?
- swannodette 16y agoThe most interesting changes to me are Javascript V8, Racket, LuaJIT.
- oddthink 16y agoI'm surprised that Racket is beating SBCL. When did that start happening?
- igouy 16y agoIt didn't - it's an artifact created by munging together different data sets. Look at a single data set - http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php http://shootout.alioth.debian.org/u32/which-programming-lang... Better, look at a direct comparison - http://shootout.alioth.debian.org/u32/compare.php?lang=racket&lang2=sbcl http://shootout.alioth.debian.org/u32/compare.php?lang=racke...
- swannodette 16y agoThey now have JIT compilation.
- brlewis 16y agoI'm impressed that PHP is now less than 20x slower than SBCL and Racket (Lisp and Scheme implementations). It's improved a lot since PHP4.
- bcl 16y agoThe fastest language is the one that you know well enough that you are actually able to implement and release your ideas to your users. Benchmarks speed is only one part of the equation.
- igouy 16y agoNope - that's the fastest language for you.
- aristidb 16y agoGHC Haskell is doing surprisingly well. That must be a testament to the extremely high quality of the GHC code generator and optimizer.
- ww520 16y agoStatic type gives compiler plenty of information for analysis and can generate very optimized code.
- alok-g 16y agoWith so much variation in the time measured for a given language? Fastest to slowest is approaching a factor of 100 in some cases. This study is useless (even if meaningful) with this much variation, and no clear explanation for why so.
- igouy 16y ago> Fastest to slowest is approaching a factor of 100 in some cases. Which cases?
- onan_barbarian 16y agoThings we don't need to hear, EVERY LAST TIME anyone says anything quantifiable about programming language performance: 1. People are more or less productive in different languages. 2. If a task can be done mostly in a library the speed of the programming language is less important. 3. The performance difference between languages depends on the workload.