[SciPy-dev] Major CVS changes to weave

Pat Miller patmiller at llnl.gov
Thu Sep 12 16:48:22 CDT 2002


"Steve M. Robbins" wrote:
> I don't mean to second-guess your decision, especially since I know nothing
> of the details of SCXX nor of boost python.  However, portability is
> probably one of the stronger reasons to switch TO boost.  Those guys are
> absolutely rabid about supporting a wide variety of compiler/platform

Yes, but it seems like overkill for what Eric needs for weave (me too!).
It also (currently) has issues with symbol table size and speed.  

>> blitz++ was upgraded to the latest CVS.  It compiles about twice as fast
>> as the old blitz and looks like it supports a large number of compilers
> Woohoo!  Sounds good

My work that Eric was alluding to was a compiled alternative to the
blitz++
module that works like:

from compilation.numeric import compiler

...
compiler()
a = b + c*d - 3
end_compiler()
...

instead of weave.blitz('a = b+c*d-3',[a])

Rather than using C++ expression templates, this recreates the Python
AST for the code between the compiler "pragmas" (special functions,
really) and builds a C (not C++) equivalent with a maximum of 1
heap allocation per assignment (tests at runtime to see if the left
hand side is assignable and uses it if possible).

This is wicked fast (both in terms of compilation time < 1 sec and
runtime).

For Pearu's LaPlace example, I get 900-1800X speedup over the original
Python with Numeric arrays --- equivalent to hand-written C.

Pat

-- 
Patrick Miller | (925) 423-0309 |
http://www.llnl.gov/CASC/people/pmiller

Work is of two kinds: first, altering the position of matter at or near
the
earth's surface relative to other matter; second, telling other people
to do
so. The first is unpleasant and ill-paid; the second is pleasant and
highly
paid. -- Bertrand Russell, philosopher, mathematician, and author
(1872-1970)



More information about the Scipy-dev mailing list