[SciPy-dev] [SciPy-user] Arange has been sped up

Arnd Baecker arnd.baecker at web.de
Sun Dec 11 04:53:19 CST 2005


Hi,

On Sun, 11 Dec 2005, Travis Oliphant wrote:

> Friends,
>
> I've just sped up arange using individual filling loops like numarray
> does -- and added (untested) complex arange functionality.
>
> The benchmarks are showing a marked improvement in the arange function
> for scipy over its previous performance.  Thanks for the testing.


On laptop I get for `python test_bench.py`:

Python 2.3.5 (#2, Sep  4 2005, 22:01:42)
[GCC 3.3.5 (Debian 1:3.3.5-13)]
Optimization flags: -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
CPU info: getNCPUs has_mmx has_sse is_32bit is_Intel is_Pentium
is_PentiumII is_PentiumIII is_i686 is_singleCPU
Numeric: 23.8
numarray: 1.1.1


Running pystone...
Pystone(1.1) time for 50000 passes = 2.6
This machine benchmarks at 19230.8 pystones/second

scipy: 0.8.2.1623

==== bench arange ====
      size        Numeric     numarray        scipy
         10          0.12         1.77         0.18  (secs for 10000
calls)
        100          0.20         1.75         0.25  (secs for 10000
calls)
       1000          0.44         0.89         0.41  (secs for 5000 calls)
      10000          0.77         0.20         0.66  (secs for 1000 calls)
     100000          0.79         0.05         0.67  (secs for 100 calls)

scipy: 0.8.3.1630

==== bench arange ====
      size        Numeric     numarray        scipy
         10          0.12         1.77         0.18  (secs for 10000
calls)
        100          0.20         1.80         0.20  (secs for 10000
calls)
       1000          0.44         0.90         0.11  (secs for 5000 calls)
      10000          0.78         0.20         0.04  (secs for 1000 calls)
     100000          0.83         0.06         0.05  (secs for 100 calls)

So only at small array sizes Numeric is faster (if one can believe
the benchmark ;-). The data suggest that the crossover
is at around 100.
For the larger sizes getting a factor of more than 10 is impressive!!
My compliments, Travis!

Best,

Arnd




More information about the Scipy-dev mailing list