Efficiency test: 1100x1100 grid

language  function         func1 argument             CPU time
F77       gridloop1        F77 function with formula    1.0
C++       gridloop1        C++ function with formula    1.07

Python    Grid2D.__call__  vectorized numpy myfunc      1.5
Python    Grid2D.gridloop  myfunc w/math.sin          120
Python    Grid2D.gridloop  myfunc w/numpy.sin         220

F77       gridloop1        myfunc w/math.sin           40
F77       gridloop1        myfunc w/numpy.sin         180
F77       gridloop2        myfunc w/math.sin           40
F77       gridloop_vec2    vectorized myfunc            2.7
F77       gridloop2_str    F77 myfunc                   1.1
F77       gridloop_noalloc (no alloc. as in pure C++)   1.0

C         gridloop1        myfunc w/math.sin           38
C         gridloop2        myfunc w/math.sin           38
C++ (with class NumPyArray) had the same numbers as C

previousnexttable of contents