Popularity vs Performance vs Productivity

March 14th, 2011

Update July 2013:

Larry Wall: “Java is sort of the Cobol of the 21st century” , http://www.youtube.com/watch?v=LR8fQiskYII

Another perspective on languages , the most influential languages:

Screen Shot 2013-07-16 at 9.52.35 AM


Update June 2013: Python rockets to ascension and Java becomes lack luster

download

http://blog.codeeval.com/codeevalblog/most-popular-programming-languages-of-2013


 

What to choose

A more popular car will have better servicing as parts and skills will be common. A fast car is compelling but sometimes speed is easily sacrificed for comfort.

Recently the question of language efficiency verses productivity has been nagging me. The nagging question includes  what  languages, frameworks and packages are best for collecting data, analyzing data and exposing the data in a rich UI via a web browser.

Productivity

Here is an interesting graphic on speed of the programs in various languages

http://hinchcliffe.org/img/weblanguagecomparison2.png

Now the above graphic might be hard to read (wish it was larger) but what it is indicating is that Python is  roughly 10x times slower in execution time to than the equivalent programs in Java. On the other hand the expected productivity gain for a programmer is 5-10x faster in Python than Java. Now on the surface my reaction is “OK, it’s faster to program in Python, ok, but Java is 10x faster so it’s clearly the choice!”, but if I put the numbers into real life I’m like OMG – imagine a Python program that takes 1 day to write, now that same program would take 5-10 days in Java!? Thats a huge deal. Hands down, I’m going to program in Python (or something other than Java).  I can deal with some runtime performance issues.

Should a company program in Java or Python? What if Python would take a year to bring to market? What if the Java verison took 5-10 years ?!  When asked whether if he could go back and recreate Slideshare in some other language than Ruby, Jonathan Boutelle, said the question is mute. If they  had written it Java instead of Ruby they wouldn’t even be having the conversation. Sure Ruby had some scaling issues for them, but they  released  Slideshare on the market and became successful.

Here is another graphic on productivity from the book “From Java to Ruby

The data is base on a study of productivity in C, Java, Perl, Python: http://page.mi.fu-berlin.de/prechelt/Biblio//jccpprt_computer2000.pdf

As far as productivity comparisons, I think the following two images of Python vs Java explain it nicely:

Python

image21

Java equivalent

image20-300x251

http://blog.chenzhongke.com/2010/05/why-python-is-more-productive-than-java.html

For a down and out dirty view of Java sprawl that further exacerbates productivity check out:

http://chaosinmotion.com/blog/?p=622

(as a rebuttal try pursing hello world in gnu packaging : http://ftp.gnu.org/gnu/hello/hello-2.6.tar.gz )

Performance

Here is a fascinating site with empirical data on speed of languages

http://shootout.alioth.debian.org/

Current speed might be a bit misleading as popularity will impact the efforts put into the issues of a language and a language that is popular though maybe less efficient will see improvements, for example it’s interesting to see the improvements in Java over the years, and now to see the improvements in Ruby.  Though Ruby is slower than  Scala and Scala’s productivity may even be better than Ruby, Scala doesn’t, yet, have the market momentum, thus the assurances that it is a language to invest in now.

Also if speed of the language is an issue the solution is not to throw the baby out with the bathwater, ie throw out the productive programming language altogether and go for a fast one such as C or JAVA but to find the areas of slowness in the productive framework and replace those with a fast function in another language, ie polyglot programming.

Popularity

another interesting image on the current usage of languages:

http://www.dataists.com/2010/12/ranking-the-popularity-of-programming-langauges/

Languages mentioned in job postings as % and % increase

http://www.soa-at-work.com/2010/02/it-job-trends-which-technologies-you.html

The issues of showing total growth  verses % growth lend itself well to heat map representation. Here is a heat map from O’Reilly:

(Interesting to all the Oracle folks: PL/SQL shows a 51% growth 2007-2008.

Here is data from O’Reilly on growth over time, showing Python and C# growing steadily:

http://radar.oreilly.com/2009/02/state-of-the-computer-book-mar-22.html

http://radar.oreilly.com/2011/02/2010-book-market-4.html

Tiobe Index

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Here is google trends normalized by C programming (with out normalization all trends are down because google trends show hits normalized by all traffic and as general traffic increases verses computer geek searches general computer geek searches trend downwards)

Interesting how Ruby seems to be trending down (as normalized against C  searches)

another perspective: Google Insights:

Just for Fun

here  is how I started my morning, a fun video on Python, that catalyzed the above discussion:

other links


Uncategorized

  1. Trackbacks

  2. No trackbacks yet.
  1. Comments

  2. Isaac Gouy
    March 14th, 2011 at 14:19 | #1

    > “Now the above graphic might be hard to read (wish it was larger) but what it is indicating is that Python is roughly 10x faster to program in than Java.”

    No, that is not what weblanguagecomparison2.png indicates.

    The graphic indicates the run time performance of programs written in different programming languages.

    The graphic indicates the Python programs ran on average 20x slower than the Java programs.

    The graphic has no information about how it took the Python programmers to write the Python programs or how long it took the Java programmers to write the Java programmers.

    The graphic is simply (an out of date) summary from the benchmarks game website, here it is – http://shootout.alioth.debian.org/gp4/which-language-is-best.php

    Here’s an up-to-date summary http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php

  3. Kyle Hailey
    March 14th, 2011 at 18:45 | #2

    absolutely right. I changed the text to reflect this.
    What I wanted to see in a single graphic is the performance verses productivity and had thought that Dion had pointed this out with the text on the graphic showing “Range of expected development efficiency gains from productivity oriented approaches.”
    I will look into making a graphic showing productivity vs performance.

  4. Isaac Gouy
    March 14th, 2011 at 19:08 | #3

    The text still says “Python is roughly 10x times slower in execution time” when from that graphic Python averages 20x slower, and the benchmarks game shows a bunch of measurements >30x slower than Java http://shootout.alioth.debian.org/u32/python.php

    Of course, the problem with Dion’s graphic is that although it’s titled “Hard Metrics” only the program times were measurements – the “expected development efficiency gains” is plucked out of thin air ;-)

  5. Isaac Gouy
    March 14th, 2011 at 19:13 | #4

    Incidentally, the “study of productivity in C, Java, Perl, Python” only *measured* development time for the Java, C++ and C programs. Those programs were written under controlled conditions.

    In constrast, the programs written in other languages were contributed by a self selected group of program authors who responded to an online request. The development time recorded for those programs was whatever the program authors claimed :-)

  6. Isaac Gouy
    March 14th, 2011 at 19:44 | #5

    And given that Dion Hinchcliffe was trying to make a point about “Web development” let’s look at a recent published study of web development, and note the authors remark:

    - “First, the most complete solution is a Java solution. Many people might find this surprising, because scripting languages (such as Perl or PHP) tend to have higher productivity at least for small tasks.” page 3

    http://page.mi.fu-berlin.de/prechelt/Biblio/platforms07-cacm-2010.pdf

  7. Kyle Hailey
    March 14th, 2011 at 21:24 | #6

    python 3 looks to be much less than 10x slower compared to Java 6 -Xint:
    http://dboptimizer.com/wp-content/uploads/2011/03/python_vs_java_xint.png

    but gets fairly trounced vs Java 6 -Server:
    http://dboptimizer.com/wp-content/uploads/2011/03/python_vs_java_Xserver.png

  8. Isaac Gouy
    March 15th, 2011 at 15:52 | #7

    @Kyle Hailey

    When people talk about the execution time of Java programs do you think they are talking about JIT’d Java or Java without JIT?

    When you type java –version does that show mixed mode or interpreted mode?

  9. Kyle Hailey
    March 15th, 2011 at 17:19 | #8

    I have no data on Java interpreted vs just in time usage in the field. Just in time I’d expect would be about the only way people run Java in a server, which makes sense on server side code. I’ve have never been closely involved on server side code, other than Oracle connection session pooling which I wrote in my own Python process that the server communicated with. For server side code, java has the pros of the ability to do most anything one can do these days as well as the speed of execution. On the down side the code bloat and over architecting and lower productivity might be enough to cancel out gains. Gains from algorithmic speeds are going to be easily lost in badly architected code. Code that is smaller, easier to read, easier to write, easier to change will lend itself to faster changes and corrections in architecture.
    It comes down to how well the path to be implemented is known. If the path is well known the Java might just be the best choice – slower coding but a solid fast stable finished product, but how many projects know exactly what they are going to do? For projects that are going to change, which is especially true of any consumer space, the flexibility of the architecture and functionality or at least the speed at which the team can re-implement code is going to be the ultimate criteria.
    I agree that the data on coding productivity is weak, I wish there was more, but the simple code example of java vs python is powerful. If it takes me 5 days to write something in Java and 1 in Python, then hands down Python is the winner for me.
    And as far as execution speed goes, java speed was my first and still biggest issue. Most of my experience is with client side Java, and maybe Java is just not meant for client side apps, but again I see things done in 10M memory spaces running 10x faster than their java equivalents.
    It makes me wonder about the Linux tests. I assume these tests are with a running JVM and already compiled into machine code. What about something that has to start up a JVM and has not yet compiled the machine code? Isn’t that the way most client side apps go?
    Wondering if Ruby or Python will ever have machine code compiled versions. A quick google search and there seem to be a number of projects working on python compilation to machine code and/or a JVM with JIT.


× 9 = nine