55 Comments
- xeeton, on 10/12/2007, -0/+8That's a "for fun" feature at the bottom of the page.
Use it to make a benchmark showing that Javascript outperforms C. Then convince your boss that you should be using JS to develop the next purchase order module. - burke, on 10/12/2007, -0/+8I think this is rather biased towards compiled languages such as C and Fortran. Although they far outperform languages such as Ruby and Python, this doesn't take into account the extremely reduced development time and reduced bug count, caused by more intuitive syntax rules and a more extensive standard library, not to mention zero compile time.
However, the benchmarks are very, very interesting. If I could digg three times, I would. - adamsitting, on 10/12/2007, -3/+11I disagree with the above commenter. The gap is closing between compiled and non compiled languages. I see this coming true with languages such as Ruby and Eiffel. You see Eiffel compiles to C or ASP or .NET natively. And besides, other than this information hurting your ego, it is still useful none the less.
These benchmarks helped me in making my decision of which platform to code my company's very expensive new application in. Due to the coding beauty, multiple inheritance, short learning curve, and speed of Eiffel, we went with it.
I would like to see php-gtk in the tests though. - blackrim, on 10/12/2007, -0/+7you should contribute tour code to the shootout (see here http://shootout.alioth.debian.org/gp4/faq.php?#contributebenchmark)
- jesusphreak, on 10/12/2007, -0/+6crazen, those are some silly statements.
"If your writing something for home, or a small application that won't need matinence, then use a scripting language. Outside of that code for scalability"
Tell that to Google, Amazon, Digg, or numerous other companies that use scripting languages on a daily basis for large products.
And burke, that isn't the point of this.
It isn't trying to compare reduced development time or features. It is comparing speed and efficiency, and lower-level compiled languages will almost always win in that department.
Its not biased, it just following a set purpose. - CaughtThinking, on 10/12/2007, -1/+6we have to pick one because modern programmers are too lazy to learn more than one, so they make claims like, "Ruby > Java 4ever LOL sutpid Java!!1 HAHAA" etc...
Real developers are a little more sensible ;) - lawndarts, on 10/12/2007, -0/+5...I don't think that is correct.
http://shootout.alioth.debian.org/gp4/faq.php#measure
I think the fun and nonsense part comes from making your own graphs. - kirakun, on 10/12/2007, -0/+5Why do we *have* to pick *one* language to implement any software?
I've done a project where we use Perl as the main language and extended it in C with XSUB for any task that Perl was too slow at. We cut down development time with Perl while not sacrificing performance with C. - stinkyj, on 10/12/2007, -0/+5the right tool for the job, i say. C++ is vastly superior to PHP for writing desktop applications, but i'd still prefer to use PHP on my website. (not a real big php fan, just a comparison)
- jesusphreak, on 10/12/2007, -9/+13Its not a literal "oh, this beats this, yeah!"
It is a benchmark to see how they compare, not what is best or what isn't best. As you said, everyone knows C++ will kick Ruby's butt, but that isn't the point. - kalte, on 10/12/2007, -1/+5IDEs are also overrated ;)
I've developed Java/Spring apps with Eclipse and IntelliJ IDEA; both have wonderful time-saving features. However, I've developed (and continue to develop) enough mod_perl apps in my time, using VIM, to know that those features are rarely used. The argument of changing method names is always brought up but I've never needed such functionality. If you name them properly, why would you ever want to change them? You might need to change the parameters that get sent/received but your IDE won't be able to help you there (unless it can read minds, and knows which object needs to get passed from the calling methods). For those cases, grep -rn "myMethodName(" * works just fine to find all instances of the method being called.
No one will ever win this debate, because both are perfectly viable and powerful solutions. I prefer the flexibility of Perl. If you end up with spaghetti code, it's only because you aren't organizing and formatting your code well. I've had hardcore Java folks look at some of my mod_perl projects and say, "Wow, that's almost just like a J2EE web app [in structure]" (it's identical except for the clear line to follow to get to the database access - none of the Spring voodoo stuff). Oh, and you can use nifty modules like Class::MethodMaker to get rid of all those time-wasting accessor and constructor methods entirely, no IDE required. - CaughtThinking, on 10/12/2007, -0/+4The only language I'm fascinated by on this list is the Clean language. It's little heard of, but looks like a very clean (heh) and *fast* functional language.
- prockcore, on 10/12/2007, -0/+3Who wrote the ruby versions? I know ruby is slow, but come on!
I made 2 tweaks to the Mandelbrot one (ci and cr increment by 2/size each iteration.. no need to make that division every damn time, and squaring limit every pixel is ridiculous since it never changes!) and increased the speed by 10%. - jonaizen, on 10/12/2007, -0/+3I found the PHP vs. Java comparison particularly informative. I'm in the midst of developing a complex web application (not really a website) using PHP and I'm disapointed with the performance of the app. I've spent countless hours improving the speed at which it runs (and I've had much success), but I wonder if I ported the code to Java and JSP, after all the imrpovements I've made, if it would run even faster.
- kevin.gc, on 10/12/2007, -0/+3Does anyone find it strange that Java (-server) is beating C++ on almost every test? What does -server do?
- CaughtThinking, on 10/12/2007, -0/+3server i believe also optimizes for longer running programs, what it considers longer running though, i don't know.
- dhcmrlchtdj, on 10/12/2007, -1/+4-server instructs sun-derived JITs to be more aggressive during compilation. compiles take longer but the final code is usually more optimized. the client JIT doesn't optimize as much in order to be generally responsive.
oh, but as to how it beats c , not sure. it does the standard optimization tricks and can eliminate bounds and null checking in some cases, so that probably helps bring it to c 's level. - CaughtThinking, on 10/12/2007, -0/+3actually, the idea of a compiler finding bugs is *not* overrated. that's how Java IDE's can give the programmer so much development power. it's running compilation behind the scenes, so it corrects your errors *on the fly* and can suggest fitting packages and variables etc. if you're compiling to test your Java prog, you have to join the new century; no one codes like that anymore. It will generate methods, classes, interfaces, any part, by simply having a variable with an infering type.
The IDE is doing all its work behind the scenes to make your development flawless. In addition, you can refactor your code any point, and the IDE can perform all reference updating. Imagine updating dozens (hell even hundreds) of code references correctly everywhere, and changing all the file locations etc literally the click of a button. Suddenly the scripting language speed of development isn't far at all. If you're coding in VIM, or VI, Textpad etc, Java must seem like a nightmare. If you're coding in Eclipse, Java is as natural as drinking water... - CaptHarlock, on 10/12/2007, -3/+5Rather then involve myself in another techo-jihad about which language is better...
We all know I'm biased as hell since I've chose Python long ago...
The reason I chose it was due in part to TWO things...
-Community Suport (e.g. # Projects @ SourceForge)
-Speed and flexiablity of execution (memory is dirt cheap, CPU upgrades are expensive....)
A consistant performer across the board in both of these criteria was Python.
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=python&lang2=ruby
I need some code, fast.
Java, Perl, or Ruby?
No, I use Python. - Crazen, on 10/12/2007, -0/+2CaughtThinking: Being too lazy is one possibly, another is some people have worked with many languages, and have taken courses on designing computer languages. In which case they are making a statement backed by experience and education.
It's hard not to confuse the statement that a good programmer can pick up most code, with the statement you are making. - cabazorro, on 10/12/2007, -0/+2Concise:
short and to the point; saying much in a few words.
Great! This web site doesn't dance around the cost/maintenance issues. This is simple benchmark that shows again what we all programmers know which is:
If you code for a machine the machine roars back at you. If you code for humans you will be penalized, but you will spend more time with other humans, and that should make you more happy/well adjusted. - Farker, on 10/12/2007, -0/+2I took a look at some of the C and C++ code and they do things like write to stdout in the performance test loops, e.g. http://shootout.alioth.debian.org/gp4/benchmark.php?test=mandelbrot&lang=gpp&id=3
Unless they are comparing io libraries amongst the different languages (which are probably mostly written in C/C++ anyway), they really need to get rid of the libary code out of the inner loops. - vredungmand, on 10/12/2007, -0/+1As a Java programmer I can tell you that the code quality of the listed Java code is very very poor.
So poor that I would really not know where to start: Poor use of class libraries, not following standard naming conventions and in general doing many unnecessary and stupid things.
Also I would think because most programs run in a very short time the performance benchmarks are biased towards compiled or interpreted languages and not languages that use hotspot or just-in-time compilation. - zenogais, on 10/12/2007, -1/+2All these tests are rather contrived. I'm just left wondering why compare all these languages? Interpreted languages will probably never be quite as fast as compiled languages, it's just the overhead of dynamic compilation. Also I have to admit one of the most annoying non-features of python/ruby (the only two "scripting" languages I've used) is the difficulty of writing and reading binary data. In C it's a snap.
- SkaAgent11, on 10/12/2007, -0/+1I've been using this website for a while now to reference speed against the hearsay that often accompanies talking about the merits of a programming language. The bottom line is languages are just tools for a broader goal and the ultimate measure of how well done a program is dependant upon the skills of the programmer and the aptness of the language for the task. I can't think of any language, other than some of the more esoteric ones, that I find absolutely useless. This website doesn't measure the overall quality of the language, it measure the speed; there's no bias here.
- Crazen, on 10/12/2007, -0/+1jesusphreak, I've worked in many other scripting languages before both creating the applications, and often times being brought in to clean up other people's messes. I don't think I'm going out on a limb when I say that it may have brought them to market quickly but behind the scenes the developers are probably feeling a lot of pain.
timalmond: "The idea of compilers finding bugs is overrated. Type safety bugs are normally the least of my worries, and if you are testing an application, you'll find them very quickly in testing."
It's only overrated if your code is 150 lines or less. You won't find the bugs quickly in testing in anything complicated, because you probably don't go through every scenario, they are all runtime bugs. How does your Quality Assucance department feel about your statement BTW?
Kalte, so your mod perl code truely allows distributed scaling (as opposed to strictly ATOMIC functionality), fault redundancy, transactional integrity, database pooling, various internal metric collection methods, true messaging, transparent caching, true encapsulation (as opposed to perl inside-out objects), isolated scalibility of front end web servers, and back end business logic servers, database independence, aspect oriented programming (as opposed to dynamically changing inheritence heirarchy's during runtime), and I could go on an on.... And if it does, how long did it take you to do all that, and please don't mention CPAN, it doesn't come close to implementing any of those items. Perl is useful, but outside of occasional one-off log parsing, it's not worth the overhead and headaches it generates for anybody maintaining it. - sbrown123, on 10/12/2007, -0/+1A friend of mine was trying to get text indexing for searching in Ruby for his website a few months back. He tried, others tried, and came up with the same result: Ruby by itself was too slow. Now they are looking for quicker alternatives, most likely done in a language outside Ruby that Ruby code call out to. Ruby can create websites in a snap, but for some things its just too slow for.
- usidoesit, on 10/12/2007, -0/+1wtf...Eiffel?
- adamsitting, on 10/12/2007, -0/+1Actually, to compare syntax of Eiffel to php, it's clear that Eiffel, being a compiled language, is more simplified. Take a look for yourself on the benchmark pages. It shows the source code of each. I know I know, I am biased towards Eiffel. But cmon, it's a rockin language, completely Object Oriented (OO) and free.
- nuvem, on 10/12/2007, -0/+1Python?
I use Lua
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=python&lang2=lua - adamsitting, on 10/12/2007, -0/+0Lawndarts is correct. The "Fun and nonsense" is for making your own comparisons. That much code wasn't written for fun and nonsense
- Drahkar, on 10/12/2007, -0/+0I'd have to agree with you on this. You should use what is best for the job you are focusing on. You want something that has high portability? Use Java. You want something strong and fast that can be ported, but don't mind a little work on the porting. Use C++. Just generally go with your strengths and the goal at hand.
On a side note, I can understand the comparison because they all can be used as a standalone scripting platform, I don't think the comparison (At least in regards to PHP) is overly required as PHP is in general used as primarily a web script platform. While you can use it as a stand alone application, a lot of the features would have little use in that environment. As a accurate comparison I would have probably removed PHP and replaced it with Perl. - thras, on 10/12/2007, -0/+0I think that you're reading the chart wrong. Cpp wins in nearly every test. The test where it does worst in speed, (a 1.4 times faster run time for Java), it has 39 times better memory usage.
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gpp&lang2=java - Crazen, on 10/12/2007, -3/+2Actually if you want to talk about reduced bugcount, the scripting languages suck. The fact that there is no type safty, no compiler, etc... means you have spahgehtii garbage at the end that isn't maintainable. Given the scale of software true OO (not perl module crap), type safty, and a compiler are must.
If your writing something for home, or a small application that won't need matinence, then use a scripting language. Outside of that code for scalability - blackrim, on 10/12/2007, -0/+0I don't understand the point of this post. It should just be that the Computer Language Shootout site lets you choose your architecture to compare benchmarks. The computer language shootout is pretty old, and the new thing is only that you can choose your architecture (pretty cool). So THAT is the news, the new architecture choice, NOT comparing languages. Go here (http://shootout.alioth.debian.org/).
- igouy, on 10/12/2007, -0/+0"All these tests are rather contrived"
Compared to what other tests?
"I'm just left wondering why compare all these languages?"
FAQ Why are you doing this?
http://shootout.alioth.debian.org/gp4sandbox/faq.php#whydo - tuna1, on 10/12/2007, -6/+6I know Java like the back of my hand, but it's an overhyped piece of corporate *****.
- igouy, on 10/12/2007, -0/+0"The computer language shootout is pretty old"
And it's changed quite a lot over the years - new benchmarks have replaced old, new language implementations are shown, programs are compared in new ways.
The benchmarks now do more work compared to the old Doug Bagley benchmarks
http://shootout.alioth.debian.org/old/
(and some of the benchmarks on Gentoo Intel do more work, than on Debian). - igouy, on 10/12/2007, -0/+0"the code quality of the listed Java code is very very poor"
So contribute better Java programs!
http://shootout.alioth.debian.org/gp4sandbox/faq.php#contributeprogram
"run in a very short time ... biased"
4 seconds CPU seems long enough for HotSpot on these benchmarks
http://shootout.alioth.debian.org/gp4/benchmark.php?test=nbody&lang=all
http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=all - Barrie, on 10/12/2007, -1/+1Not another language war... just pick one you like and use it damnit
- yogastore, on 06/30/2008, -0/+0http://astore.amazon.com/flowtron.mosquito-20
http://astore.amazon.com/flowtron.insect.killer-20
http://astore.amazon.com/evaporative.air.cooler-20
http://astore.amazon.com/air.swamp.cooler-20
http://astore.amazon.com/braun.electric.kettle-20
http://astore.amazon.com/cordless.electric.kettle- ...
http://astore.amazon.com/canon.battery.charger-20
http://astore.amazon.com/12.volt.battery.charger-2 ...
http://astore.amazon.com/furniture.chaise.lounge-2 ...
http://astore.amazon.com/outdoor.chaise.lounge-20 - bkorte, on 10/12/2007, -2/+2What about ColdFusion?
Here come the flames! :-) - CaughtThinking, on 10/12/2007, -1/+1poor coldfusion. the redheaded stepchild of web programming. people automatically disregard anything resembling markup, it's just unfair.
- igouy, on 10/12/2007, -0/+0"No digg....
Who in their right mind compares Ruby to C++? Or PHP to Java???"
We don't pre-judge whether some specific comparison will be useful to someone - we present data - make the comparisons you find useful.
See: Flawed Comparisons
http://shootout.alioth.debian.org/gp4sandbox/miscfile.php?file=benchmarking&title=Flawed%20Benchmarks#comparison
(Incidentally, there are people who say that Ruby and PHP are general purpose programming languages.) - bfulgham, on 10/12/2007, -0/+0You might notice that the newer benchmarks (which are slowly replacing the original Doug Bagley benchmarks) suffer less from this problem. We have been attempting to reduce some of these flaws, and welcome contributions of code to replace the existing tests.
- inactive, on 10/12/2007, -1/+0I was just about to make the same comment. Thanks for being my human shield.. :-P
- frontpage, on 10/12/2007, -2/+1Well that's just great then.
_________________________
http://www.quit-promoting-your-site-with-vapid-comments-please.com - atrerra, on 10/12/2007, -4/+2Pfft. No Assembly?
I wanted to see ASM v. PHP
;-) - timalmond, on 10/12/2007, -2/+0crazen,
The idea of compilers finding bugs is overrated. Type safety bugs are normally the least of my worries, and if you are testing an application, you'll find them very quickly in testing. - atariby, on 10/12/2007, -4/+1ASM rocks!!
-
Show 51 - 55 of 55 discussions



What is Digg?
Check out the new & improved