comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Speed does matter
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Speed does matter [message #91780 is a reply to message #91774] Tue, 25 August 2015 14:35 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 8/25/15 7:03 AM, Kallisthène wrote:
> Le mardi 25 août 2015 10:32:22 UTC+2, superchromix a écrit :
>> Nice comparison. On my desktop, running IDL 8.5 and Matlab 2010b,
>> I get the following results:
>>
>> IDL: % Time elapsed: 6.4400001 seconds.
>>
>> MATLAB 2010b: Elapsed time is 0.594112 seconds.
>>
>> Again, MATLAB for loops run faster by a factor of ~10.
>
> Great idea,
>
>
> I ran also these codes, with bigger numbers, 1000 instead of 500 for
> each dimension and with Matlab 2015a I got 6.3 secondes to compare
> with 102 secondes on my IDL 8.5. My desktop runs 4 cores and has 12
> Go RAM and it runs faster with Matlab by a factor of 16 ! Damn.
>

For what it's worth, I got about a 5x speedup of IDL over Python. I used
1000 elements for each dimension:

$ python mg_loopspeed.py
222.15 secs

Code is:

import numpy as np
import time

nx = 1000
ny = 1000
nz = 1000

arr = np.zeros((nx, ny, nz))

tic = time.clock()

for z in xrange(nz):
for y in xrange(ny):
for x in xrange(nx):
arr[x, y, z] = 1.0

toc = time.clock()
print '%0.2f secs' % (toc - tic)

For comparison, my IDL time:

$ idl -e ".run mg_loopspeed"
IDL Version 8.5, Mac OS X (darwin x86_64 m64).
(c) 2015, Exelis Visual Information Solutions, Inc., a subsidiary of
Harris Corporation.

% Compiled module: $MAIN$.
% Compiled module: TIC.
Elapsed Time: 47.486635

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Any way to initialize mapping in IDL with WKT or a Proj.4 string?
Next Topic: getting uniform cadence data

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:06:39 PDT 2025

Total time taken to generate the page: 0.40037 seconds