|
From: Sasha <nd...@ma...> - 2006-01-17 22:26:34
|
> python -m timeit -s "x=3Dbool(0)" "x or x" 10000000 loops, best of 3: 0.111 usec per loop > python -m timeit -s "from numpy import bool_, logical_or as or_; x=3Dbool= _(0)" "or_(x, x)" 100000 loops, best of 3: 3.25 usec per loop Numpy is 32x slower than python -- not very good. Interestingly, > python -m timeit -s "from numpy import bool_; x=3Dbool_(0)" "x or x" 1000000 loops, best of 3: 0.388 usec per loop -- sasha |