From: "Eric Sampson" <ericNOSPM.sampson@mathworks.com>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webcrossing
Newsgroups: comp.soft-sys.matlab
Subject: Re: About alternatives to Matlab
Message-ID: <ef444d0.16@webcrossing.raydaftYaTP>
Date: Wed, 29 Nov 2006 18:23:36 -0500
References: <1161613941.550194.204870@e3g2000cwe.googlegroups.com> <1163711343.870829.110030@h48g2000cwc.googlegroups.com>
Lines: 50
NNTP-Posting-Host: 144.212.4.9
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:381159



sturlamolden wrote:
>
> I have used Matlab for years, and has recently changed to Python.
> To compare Matlab with NumPy we can e.g. use the D4 discrete
> wavelet
> transform. I have here coded it in Matlab and Python/NumPy using
> Tim
> Swelden's lifting scheme.
>
(snip code)
 
> Now let's do benchmark on my laptop (1.73 GHz Pentium M, 0.99 GB
> RAM).
> I have stopped paying for Matlab maintenance (for reasons that will
> be
> obvious), so I only have R14 Service Pack 2 for comparison.
>
> First we try Matlab (R14 Service Pack 2):
>
>>> x = rand(2^23,1);
>>> tic; D4_Transform(x); toc
> Elapsed time is 27.145438 seconds.
>
>
> Then we Python 2.4.4 with NumPy 1.0:
>
> C:\develop\python\D4>python D4.py
> Elapsed time is 3.364887 seconds
>
(snip)
> Cheers,
> Sturla Molden
>

Hi Sturla,

For comparison purposes, I ran your code under MATLAB R2006b and
Python 2.4.4, both on my P4 3GHz laptop with 1GB of ram. I obtained
the following timing:

Python: 1.88 sec
MATLAB: 2.85 sec (your code)
MATLAB: 2.35 sec (my code, slight mods)

Although Python maintains an advantage, it is not nearly as dramatic
as your timings.

Best regards,
Eric Sampson
The MathWorks,Inc.