<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>/var/log/mind - Latest Comments in Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://var-log-mind.disqus.com/</link><description>Dhananjay Nene’s free (as in free speech) opinions on all things related to Software Engineering</description><atom:link href="https://var-log-mind.disqus.com/performance_comparison_c_java_python_ruby_jython_jruby_groovy/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Sat, 04 Jul 2009 16:08:26 -0000</lastBuildDate><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490111</link><description>&lt;p&gt;Wont comment on any other language but your python code is definitely not upto the mark. If you say about comapring apples with apples... at least use all the benefits that a language offers. When you are using pointers in C++ to gain speed why are you are not using the built in constructs of python which will give speed advantage ?&lt;br&gt; Do you feel C++ would have given the same reults had you used array instead of pointers... ?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vivek Khurana</dc:creator><pubDate>Sat, 04 Jul 2009 16:08:26 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490104</link><description>&lt;p&gt;Hello Dhananjay. &lt;br&gt;I have a rather generic question concerning a specific implementation. I'm in the process of designing and coding up a social media/comment powered advertising engine. My background is C++, but I've been using PHP so far.&lt;/p&gt;&lt;p&gt;I'm curious what type of web based coding language you would suggest as the fastest for grabbing data from various locations and passing it back and forth.&lt;/p&gt;&lt;p&gt;Thanks for your time sir,&lt;br&gt;Mark Essel&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mark Essel</dc:creator><pubDate>Fri, 26 Jun 2009 13:33:52 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490007</link><description>&lt;p&gt;Consider rebenchmarking, this time with profile-guided optimization for C++.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ebrahim</dc:creator><pubDate>Fri, 27 Mar 2009 19:13:00 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442489998</link><description>&lt;p&gt;&amp;gt; it is probably close to the kind of code many programmers write (and maintain) on a day to day basis&lt;br&gt;Yes, but most of what many programmers write on a day-to-day basis is not remotely performance critical.&lt;/p&gt;&lt;p&gt;So it's nice that code that's inefficient is still tolerably fast, as it means your unit tests finish quickly, but what often matters to application performance is the degree to which you can tune the performance critical components of the system.&lt;/p&gt;&lt;p&gt;So to understand whether or not an application in the language can be made to perform well, you need to test code that's as fast as the language lets you tune it. This can make a big difference - for example, languages with constant vs mutable vs copy-on-write strings which are as fast as each other in benchmarks get big differences in applications.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Pete Kirkham</dc:creator><pubDate>Mon, 23 Mar 2009 11:33:55 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490096</link><description>&lt;p&gt;I did another micro test that had simple GUI and discovered that&lt;/p&gt;&lt;p&gt;- memory consumption differs dramatically and can exclude Java from the list of options&lt;/p&gt;&lt;p&gt;- apparently sane code may run so slow that normal performance is irrelevant and the probability to hit a trap is what matters. If you want something that just works, C++/Pascal/C# are safe, Java is less safe possibly because the default VM does not JIT compile some code, and PHP/Ruby/Python may really surprise you.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andrey</dc:creator><pubDate>Fri, 27 Feb 2009 10:01:32 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490086</link><description>&lt;p&gt;this code:&lt;br&gt;public Person kill(int nth)&lt;br&gt;   {&lt;br&gt;      Person current = first;&lt;br&gt;      while (nth--&amp;gt;=0)&lt;br&gt;      {&lt;br&gt;         current = current.getNext();&lt;br&gt;      }&lt;br&gt;      current.shout();&lt;br&gt;      first = current;&lt;br&gt;      return current;&lt;br&gt;   }&lt;/p&gt;&lt;p&gt;reduces the time per iteration by 50%&lt;/p&gt;&lt;p&gt;i can optimize it further, but that would be a punch in the face of readability&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">HamsterofDeath</dc:creator><pubDate>Fri, 20 Feb 2009 17:31:46 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490082</link><description>&lt;p&gt;for more fun, i copied the com.dnene.josephus implementation at the top, and ran it .. on my system it timed in at 1.5 microseconds, compared to 0,75 microseconds for mine.  so my rather obfuscated implementation is twice as fast for JDK 1.5.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 22:52:22 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490078</link><description>&lt;p&gt;ok, i give up, this comment thing keeps mangling the code&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 21:18:50 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490073</link><description>&lt;p&gt;ok, mangled again, this time i typed it instead of copy/pasted:&lt;br&gt;static int answer(int n, int k, int[] nextAlive) {&lt;br&gt;Arrays.fill(nextAlive, 1);&lt;br&gt;int die = 0;&lt;br&gt;int temp = n-1;&lt;br&gt;for(int ctr = 0; ctr &amp;lt; n - 1; ++ ctr) {&lt;br&gt;for(int skipAlive = 0; skipAlive = n) {&lt;br&gt;die -= n;&lt;br&gt;}&lt;br&gt;}&lt;br&gt;nextAlive[temp] += nextAlive[die];&lt;br&gt;die += nextAlive[die];&lt;br&gt;if (die &amp;gt;= n) {&lt;br&gt;die -= n;&lt;br&gt;}&lt;br&gt;}&lt;br&gt;return die + 1;&lt;br&gt;}&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 21:17:40 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490070</link><description>&lt;p&gt;mangled again ... don'e know why:&lt;br&gt;static int answer(int n, int k, int[] nextAlive) {&lt;br&gt;Arrays.fill(nextAlive, 1);&lt;br&gt;int die = 0;&lt;br&gt;int temp = n - 1;&lt;br&gt;for (int ctr = 0; ctr &amp;lt; n - 1; ++ctr) {&lt;br&gt;for (int skipAlive = 0; skipAlive = n) {&lt;br&gt;die -= n;&lt;br&gt;}&lt;br&gt;}&lt;br&gt;nextAlive[temp] += nextAlive[die];&lt;br&gt;die += nextAlive[die];&lt;br&gt;if (die &amp;gt;= n) {&lt;br&gt;die -= n;&lt;br&gt;}&lt;br&gt;}&lt;br&gt;return die + 1;&lt;br&gt;}&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 21:12:31 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490058</link><description>&lt;p&gt;somehow the "answer" function above got mangled, here it is:&lt;/p&gt;&lt;p&gt;    static int answer(int n, int k, int[] nextAlive) {&lt;br&gt;        Arrays.fill(nextAlive, 1);&lt;br&gt;        int die = 0;&lt;br&gt;        int temp = n - 1;&lt;br&gt;        for (int ctr = 0; ctr &amp;lt; n - 1; ++ctr) {&lt;br&gt;            for (int skipAlive = 0; skipAlive = n) {&lt;br&gt;                    die -= n;&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;            nextAlive[temp] += nextAlive[die];&lt;br&gt;            die += nextAlive[die];&lt;br&gt;            if (die &amp;gt;= n) {&lt;br&gt;                die -= n;&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;        return die + 1;&lt;br&gt;    }&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 21:09:42 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490056</link><description>&lt;p&gt;actually i see it wasn't really any faster ... your times were microseconds, i was thinking milliseconds .. gosh, how embarassing&lt;/p&gt;&lt;p&gt;however, this version executes in 750 microseconds on a dual core 2.6 ghz intel, so presumably it's a bit faster ... a fair comparison to your time would be 750 * 2.6/2.1 = 928 microseconds. ALSO, i'm using jdk 1.5, not 1.6, how big a difference that makes i don' t know.&lt;/p&gt;&lt;p&gt;i would have thought the difference in speed would be greater, considering i'm using nothing but int's, no object references.  shows how efficient javas heap management and object reference implementation is?&lt;/p&gt;&lt;p&gt; static int answer(int n, int k, int[] nextAlive) {&lt;br&gt;        Arrays.fill(nextAlive, 1);&lt;br&gt;        int die = 0;&lt;br&gt;        int temp = n - 1;&lt;br&gt;        for (int ctr = 0; ctr &amp;lt; n - 1; ++ctr) {&lt;br&gt;            for (int skipAlive = 0; skipAlive = n) {&lt;br&gt;                    die -= n;&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;            nextAlive[temp] += nextAlive[die];&lt;br&gt;            die += nextAlive[die];&lt;br&gt;            if (die &amp;gt;= n) {&lt;br&gt;                die -= n;&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;        return die + 1;&lt;br&gt;    }&lt;br&gt;    public static void main(String[] args) {&lt;br&gt;        int ITER = 100000;&lt;br&gt;        long start = System.nanoTime();&lt;br&gt;        int n = 40;&lt;br&gt;        int[] nextAlive = new int[n];&lt;br&gt;        for (int i = 0 ; i &amp;lt; ITER ; i++)  {&lt;br&gt;            answer(n, 3, nextAlive);&lt;br&gt;        }&lt;br&gt;        long end = System.nanoTime();&lt;br&gt;        System.out.println("Time per iteration = " + ((end - start) / (ITER )) + " nanoseconds.");&lt;br&gt;    }&lt;br&gt;}&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 21:07:00 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490044</link><description>&lt;p&gt;too much fun, i couldn't help myself ... OK, previous was almost right, but it wasn't handling the "skip 0" or depending how you enumerate, call that the "skip 1" kill case.  I fixed that, so answer(10,1) is the kill w/o skipping case.  I compared my answer with they guy who looked at Mathematica results, above, and I get the same.&lt;/p&gt;&lt;p&gt;** MY EXECUTION TIME ?? ** 1751 NANOSECONDS !!!&lt;/p&gt;&lt;p&gt;anonymous does ChurchLady superior dance, ala Dana Carvey =)&lt;/p&gt;&lt;p&gt;(of course C++ would probably be 2 to 4 times faster, I'm betting)&lt;/p&gt;&lt;p&gt;complete code list (27 lines !!! ... bit obfuscated, i admit =) )&lt;br&gt;import java.util.Arrays; &lt;br&gt;public class Main {&lt;br&gt;    static int answer(int n, int k) {&lt;br&gt;        int[] nextAlive = new int[n];&lt;br&gt;        Arrays.fill(nextAlive, 1);&lt;br&gt;        int die = 0;&lt;br&gt;        int temp = n - 1;&lt;br&gt;        for (int ctr = 0; ctr &amp;lt; n - 1; ++ctr) {&lt;br&gt;            for (int skipAlive = 0; skipAlive &amp;lt; k - 1; ++skipAlive) {&lt;br&gt;                temp = die;&lt;br&gt;                die += nextAlive[die % n];&lt;br&gt;            }&lt;br&gt;            nextAlive[temp % n] += nextAlive[die % n];&lt;br&gt;            die += nextAlive[die % n];&lt;br&gt;        }&lt;br&gt;        return (die % n) + 1;&lt;br&gt;    }&lt;br&gt;    public static void main(String[] args) {&lt;br&gt;        int ITER = 100000;&lt;br&gt;        long start = System.nanoTime();&lt;br&gt;        for (int i = 0 ; i &amp;lt; ITER ; i++)  {&lt;br&gt;            answer(40, 3);&lt;br&gt;        }&lt;br&gt;        long end = System.nanoTime();&lt;br&gt;        System.out.println("Time per iteration = " + ((end - start) / (ITER )) + " nanoseconds.");&lt;br&gt;    }&lt;br&gt;}&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 20:45:45 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490040</link><description>&lt;p&gt;comment - what im doing above is just maintaining a singly linked ciruclar list using modulo n arithmetic, where "nextAlive" gives the "pointer" to the next item in the list, provided you add that value to your current index location -- modulo n.  when one of 'em get killed, i modify the "next item" pointer for the previous "alive" that got skipped (kept in temp), and reposition the current index to be the next alive, for the next round of skipping (die += nextAlive[die%n]).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 10:45:37 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490033</link><description>&lt;p&gt;actually that version probably has O(n^2) performance so wouldn't do well for large n.  one more try&lt;/p&gt;&lt;p&gt;int answer(int n, int k) {&lt;br&gt;int[] nextAlive = new int[n];&lt;br&gt;Arrays.fill(nextAlive, 1);&lt;br&gt;int die = 0;&lt;br&gt;for(int ctr = 0; ctr &amp;lt; n-1; ++ ctr) {&lt;br&gt;int temp = 0;&lt;br&gt;for(int skipAlive = 0; skipAlive &amp;lt; k; ++ skipAlive) {&lt;br&gt;temp = die;&lt;br&gt;die += nextAlive[ die % n  ];&lt;br&gt;}&lt;br&gt;nextAlive[ temp % n ] += nextAlive[ die % n ];&lt;br&gt;die += nextAlive[ die % n ];&lt;br&gt;}&lt;br&gt;return (die % n) + 1;&lt;br&gt;}&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 10:37:06 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490027</link><description>&lt;p&gt;i now also think the \++die\ should be moved after the if (!hesDead...) { test in the while(skip&amp;lt;k) loop&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 10:14:41 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490022</link><description>&lt;p&gt;last line should have been&lt;br&gt;"return (die % n) + 1;" since you want to number the people from 1 .. n, not 0 ... n-1.&lt;/p&gt;&lt;p&gt;otherwise still looks ok to me&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 10:04:03 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442490014</link><description>&lt;p&gt;this is an absurdly simple problem, i don't know how you managed to come up with such code.  i'm predicting this will have a fast run time.&lt;/p&gt;&lt;p&gt;// looks ok to me  at the moment ... after i hit submit&lt;br&gt;// i'll probably see a mistake ! arrgh&lt;br&gt;int answer(int n, int k) {&lt;br&gt;boolean[] hesDeadJim = new boolean[n];&lt;br&gt;Arrays.fill(hesDeadJim, false);&lt;br&gt;int die = 0;&lt;br&gt;for(int ctr = 0; ctr &amp;lt; n-1; ++ ctr) {&lt;br&gt;int skip = 0;&lt;br&gt;while(skip &amp;lt; k) {&lt;br&gt;++ die;&lt;br&gt;if (! hesDeadJim[die % n]) {&lt;br&gt;++ skip;&lt;br&gt;}&lt;br&gt;}&lt;br&gt;hesDeadJim[die % n] = true;&lt;br&gt;}&lt;br&gt;return die % n;&lt;br&gt;}&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Thu, 19 Feb 2009 10:00:24 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-442489990</link><description>&lt;p&gt;This would be a great place to post a Cython comparison as well.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ben Racine</dc:creator><pubDate>Thu, 29 Jan 2009 00:00:59 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-1725906</link><description>&lt;p&gt;I like this 'deque' version since it adds a clarifying level of abstraction to the original problem formulation - that we are repeatedly selecting every nth item from a ring buffer.&lt;/p&gt;&lt;p&gt;It could be cast in an object form with the same external interface as the original.  In some sense that makes it the same object implementation, since it shouldn't matter whether we implement the linked list pointers in Python or use the ones in the compiled deque code.&lt;/p&gt;&lt;p&gt;from collections import deque&lt;br&gt;class Person(object):&lt;br&gt;..__slots__ = 'count'&lt;br&gt;..def __init__(self, count):&lt;br&gt;....self.count = count&lt;br&gt;..def shout(self, cnt, nth): return cnt # dummy method&lt;br&gt;class Chain(deque):&lt;br&gt;..def __init__(self, size):&lt;br&gt;....alist = [Person(i) for i in xrange(size)]&lt;br&gt;....deque.__init__(self, alist)&lt;br&gt;..def kill(self, nth):&lt;br&gt;....n1 = -(nth-1)&lt;br&gt;....while len(self):&lt;br&gt;......self.rotate(n1)&lt;br&gt;......last=self.popleft()&lt;br&gt;....return last&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">paulj</dc:creator><pubDate>Thu, 21 Aug 2008 18:49:02 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-1605234</link><description>&lt;p&gt;java version: 26922 milliseconds &lt;br&gt;my c++ version: 21422 milliseconds&lt;/p&gt;&lt;p&gt;sorry, previously I wrote microseconds intead of milliseconds&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alberto Bignotti</dc:creator><pubDate>Mon, 18 Aug 2008 17:47:07 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-1601000</link><description>&lt;p&gt;the correct link is&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.bigno.it/speed/cppspeed.html" rel="nofollow noopener" target="_blank" title="www.bigno.it/speed/cppspeed.html"&gt;www.bigno.it/speed/cppspeed...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;sorry for the mistake&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alberto Bignotti</dc:creator><pubDate>Mon, 18 Aug 2008 13:14:59 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-1600767</link><description>&lt;p&gt;I modified c++ version adding 21 lines of code.&lt;/p&gt;&lt;p&gt;On my machine, making a loop of 10000000 iterations: &lt;br&gt;java version: 26922 milliseconds &lt;br&gt;my c++ version: 21422 microseconds&lt;/p&gt;&lt;p&gt;see details on &lt;a href="whttp://www.bigno.it/speed/cppspeed.html" rel="nofollow noopener" target="_blank" title="whttp://www.bigno.it/speed/cppspeed.html"&gt;whttp://www.bigno.it/speed/...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alberto Bignotti</dc:creator><pubDate>Mon, 18 Aug 2008 13:05:45 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-1210698</link><description>&lt;p&gt;For many software problems, it helps a lot to know the +libraries+, not just the +language+.&lt;/p&gt;&lt;p&gt;import time&lt;br&gt;from collections import deque&lt;br&gt;ITER = 100000&lt;br&gt;START_LEN = 40&lt;br&gt;KILL_EVERY = 3&lt;br&gt;start = time.time()&lt;br&gt;initial_chain = range(1, 1+START_LEN)&lt;br&gt;for i in xrange(ITER):&lt;br&gt;    chain = deque(initial_chain)&lt;br&gt;    while len(chain) &amp;gt; 1:&lt;br&gt;        chain.rotate(-(KILL_EVERY-1))&lt;br&gt;        chain.popleft()&lt;br&gt;end = time.time()&lt;br&gt;print 'Time per iteration = %s microseconds ' % ((end - start) / float(ITER) * 1e6)&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Francis Carr</dc:creator><pubDate>Wed, 13 Aug 2008 12:22:20 -0000</pubDate></item><item><title>Re: Performance Comparison &amp;#8211; C++ / Java / Python / Ruby/ Jython / JRuby / Groovy</title><link>http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/#comment-1209724</link><description>&lt;p&gt;As usual with this kind of benchmarks, part of the differences comes from non-idiomatic code. wrt/ the Python version, it's not pythonic code, it's Java code written in Python. I don't have time for this right now, but I'll try and propose a more pythonic solution.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bruno</dc:creator><pubDate>Thu, 07 Aug 2008 06:18:18 -0000</pubDate></item></channel></rss>