Arnd Baecker wrote: >Bingo! Only numpy 0.9.9.2749 + math is slower than >Numeric+math by a factor 1.6 and mod-array is 2.5 times slower >than numpy. >It would be nice if you could have a look at the module operation, >if possible ... > >
O.K. I looked at how Python computed modulo and implemented the same thing for both umath (the remainder function) and scalarmath. The result is a significant speed up for modulo...yeah... I also placed in hooks so you can replace the scalarmath (for int, float, and complex) with the Python version of math (this works because the int, float, and complex scalars are sub-classes of the corresponding Python object). import numpy.core.scalarmath as ncs # Replace "scalarmath" with standard Python arithmetic. ncs.use_pythonmath(<int | float | complex>) # Replace "scalarmath" with actual scalarmath code. ncs.use_scalarmath(<int | float | complex>) This can test the speed of the implementations. -Travis Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion