From: Sturla Molden <sturlamol...@yahoo.no>
Date: Sat, 28 Jul 2012 16:40:38 +0200
Local: Sat, Jul 28 2012 10:40 am
Subject: Re: [cython-users] Re: Best Practices for passing numpy data pointer to C ?
> I prepared some quick-and-dirty benchmarks of the behavior I need at I took the liberty to update your banchmarks (see attachment). For > https://github.com/jakevdp/memview_benchmarks/ -- I'd be interested if > people more familiar with memory-views could take a look and let me > know if I'm missing anything there. > Jake example I noticed that GCC was clever enough to optimize out all the loops in your pointer_arith.pyx... Here are the timings I got from the updated version in the attachment. I D:\memview-benchmarks\new>python runme.py
There is a table in the attached PDF that should be easier to read.
The overhead from the numpy versions comes from slicing the ndarray. In And consider this: Numerical code using array slicing in Fortran90 with If you wonder why using np.dot was faster than writing out the loop in Conclusion:
Memoryviews are extremely fast, comparable to pointer arithmetics in C.
Now we need a real benchmark, e.g. some linear algebra solver or an FFT. Sturla
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||||||||