Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95125 > unrolled thread

Python speed

Started byrogerh906@gmail.com
First post2015-08-07 07:08 -0700
Last post2015-08-07 23:57 +0000
Articles 7 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Python speed rogerh906@gmail.com - 2015-08-07 07:08 -0700
    Re: Python speed beliavsky@aol.com - 2015-08-07 09:57 -0700
      Re: Python speed Laura Creighton <lac@openend.se> - 2015-08-07 19:17 +0200
        Re: Python speed Christian Gollwitzer <auriocus@gmx.de> - 2015-08-07 23:26 +0200
          Re: Python speed Laura Creighton <lac@openend.se> - 2015-08-08 00:01 +0200
    Re: Python speed rogerh906@gmail.com - 2015-08-07 12:30 -0700
    Re: Python speed Grant Edwards <invalid@invalid.invalid> - 2015-08-07 23:57 +0000

#95125 — Python speed

Fromrogerh906@gmail.com
Date2015-08-07 07:08 -0700
SubjectPython speed
Message-ID<2261c8c6-77ba-453d-9205-0a922fa67c81@googlegroups.com>
Can anyone compare PyNum calculation speed to Fortran?

This is for a number crunching program working with large files.

Roger

[toc] | [next] | [standalone]


#95131

Frombeliavsky@aol.com
Date2015-08-07 09:57 -0700
Message-ID<04b7cdd0-1eb0-4378-9d14-38e97b4456a7@googlegroups.com>
In reply to#95125
On Friday, August 7, 2015 at 10:08:37 AM UTC-4, roge...@gmail.com wrote:
> Can anyone compare PyNum calculation speed to Fortran?
> 
> This is for a number crunching program working with large files.
> 
> Roger

Did you mean NumPy? It depends on the program. Here are two posts that compared speeds.

Comparing Python, NumPy, Matlab, Fortran, etc. (2009) https://modelingguru.nasa.gov/docs/DOC-1762

Optimizing Python in the Real World: NumPy, Numba, and the NUFFT (2015)
https://jakevdp.github.io/blog/2015/02/24/optimizing-python-with-numpy-and-numba/

[toc] | [prev] | [next] | [standalone]


#95134

FromLaura Creighton <lac@openend.se>
Date2015-08-07 19:17 +0200
Message-ID<mailman.1312.1438967902.3674.python-list@python.org>
In reply to#95131
In a message of Fri, 07 Aug 2015 09:57:26 -0700, beliavsky--- via Python-list w
rites:
>On Friday, August 7, 2015 at 10:08:37 AM UTC-4, roge...@gmail.com wrote:
>> Can anyone compare PyNum calculation speed to Fortran?
>> 
>> This is for a number crunching program working with large files.
>> 
>> Roger

And for speed you may be better off with PyPy than with NumPy
http://speed.pypy.org/timeline/

but, as is always the case when measuring the speed of things,
'it all depends on what you are doing'.  Do you need to link to
existing Fortran or C libraries?  If the answer is no, and you
really only are doing crunching, and your crunching is done
in loops which run for a significant amount of time -- then PyPy
is generally faster than Fortran.

If you are spending most of your time in matplotlib graphing
your results, you will  be unhappy with PyPy performance.

pypy-dev@python.org is a better place to discuss performance of
PyPy, though while http://mail.scipy.org/mailman/listinfo/numpy-discussion
is a better place to discuss numpy.

scipy.org has been down all day, alas.  But the Americans should be
awake now and dealing with it.

Laura

[toc] | [prev] | [next] | [standalone]


#95142

FromChristian Gollwitzer <auriocus@gmx.de>
Date2015-08-07 23:26 +0200
Message-ID<mq37nl$j18$1@dont-email.me>
In reply to#95134
Am 07.08.2015 um 19:17 schrieb Laura Creighton:
> you
> really only are doing crunching, and your crunching is done
> in loops which run for a significant amount of time -- then PyPy
> is generally faster than Fortran.

PyPy faster than Fortran in a tight number-crunching loop? Sorry I find 
this very hard to believe. I could accept that PyPy can match the speed 
of Fortran in these cases, but exceeding seems highly unlikely. Was it a 
mistake, or do you have a reference that shows how PyPy can be faster 
than Fortran?

I agree with the rest what you have said.

	Christian

[toc] | [prev] | [next] | [standalone]


#95143

FromLaura Creighton <lac@openend.se>
Date2015-08-08 00:01 +0200
Message-ID<mailman.1315.1438984926.3674.python-list@python.org>
In reply to#95142
In a message of Fri, 07 Aug 2015 23:26:46 +0200, Christian Gollwitzer writes:
>Am 07.08.2015 um 19:17 schrieb Laura Creighton:
>> you
>> really only are doing crunching, and your crunching is done
>> in loops which run for a significant amount of time -- then PyPy
>> is generally faster than Fortran.
>
>PyPy faster than Fortran in a tight number-crunching loop? Sorry I find 
>this very hard to believe. I could accept that PyPy can match the speed 
>of Fortran in these cases, but exceeding seems highly unlikely. Was it a 
>mistake, or do you have a reference that shows how PyPy can be faster 
>than Fortran?
>
>I agree with the rest what you have said.
>
>	Christian

My apologies -- I went and looked it up, and it seems that the person
who reported this got taught how to vectorise his Fortran code and some
other tricks, and now his Fortran code runs between 2.5 and 3 times
faster than PyPy for his numberical benchmarks.  I seem to have got
the initial news, and never heard about the correction ....

Thank you for bringing this up.

Laura

[toc] | [prev] | [next] | [standalone]


#95139

Fromrogerh906@gmail.com
Date2015-08-07 12:30 -0700
Message-ID<051b46fe-83a7-4607-8f68-ff94df9c1ff5@googlegroups.com>
In reply to#95125
On Friday, August 7, 2015 at 8:08:37 AM UTC-6, roge...@gmail.com wrote:
> Can anyone compare PyNum calculation speed to Fortran?
> 
> This is for a number crunching program working with large files.
> 
> Roger

Thanks for answering. This will help a lot.

Roger

[toc] | [prev] | [next] | [standalone]


#95145

FromGrant Edwards <invalid@invalid.invalid>
Date2015-08-07 23:57 +0000
Message-ID<mq3gm2$suq$1@reader1.panix.com>
In reply to#95125
On 2015-08-07, rogerh906@gmail.com <rogerh906@gmail.com> wrote:

> Can anyone compare PyNum calculation speed to Fortran?
>
> This is for a number crunching program working with large files.

Well I can tell you how the numerical analysis and data visualization
programs _I_ use to write would compare to Fortran: The Python
programs were infinitely faster than Fortran because the probability I
could have gotten equivelent Fortran programs to work before the data
became moot was pretty much zero.

On a more serious note, almost all of the heavy lifting in the
programs I wrote (array operations, curve fitting, Delaunay
triangulation, etc.) was all done by libraries written in Fortan and
C.  So I doubt the difference between Fortran and Python would have
mattered (assuming I _could_ have written equivalent programs in
Fortran).

-- 
Grant

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web