benchmark

M8R-n7vorv at mailinator.com M8R-n7vorv at mailinator.com
Thu Aug 7 12:59:14 CEST 2008


On Aug 7, 2:52 pm, M8R-n7v... at mailinator.com wrote:
> On Aug 7, 6:38 am, bearophileH... at lycos.com wrote:
>
> > On Aug 7, 2:05 am, "Jack" <nos... at invalid.com> wrote:
>
> > > I know one benchmark doesn't mean much but it's still disappointing to see
> > > Python as one of the slowest languages in the test:
>
> > >http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-p...
>
> > That Python code is bad, it contains range() instead of xrange, the
> > big loop is in the main code instead of inside a function, uses ==
> > None, etc. That person can try this (with Psyco), I have changed very
> > little, the code is essentially the same:
>
> Yes, this was pointed out in the comments. I had updated the code to
> use
> xrange and is and is not instead of range, == and !=, which is how
> the
> benchmark got updated to 192 microseconds. Moving the main loop into
> a main function resulted in no discernible difference.
>
> Testing with psyco resulted in a time of 33 microseconds per
> iteration.
>

I have since updated the post to reflect the python with psyco timings
as well.



More information about the Python-list mailing list