Cython
A Very Brief Introduction!
Cython is a variant of Python which can be compiled directly to C. If used judiciously, this can be used to make certain code much faster with very little effort on your part.
Cython website: http://cython.org/
1.93950541068
125 loops, best of 3: 3.74 ms per loop
Defined math, sin_sum_cython0
Auto-generated code...625 loops, best of 3: 2.2 ms per loop
1.70000000000000
Talk about type declaration and direct calling of C code...
Defined sin_sum_cython
Auto-generated code...625 loops, best of 3: 434 µs per loop
5.06912442396313
1.939505410680705
CPU time: 3.34 s, Wall time: 4.56 s
7695.85253456221
You probably can't beat this by much without a new idea...
Aside: you might wonder why the Cythonization process couldn't be incorporated directly into the Python interpreter, so that code is automatically fast while still being easy to read and write. This is the design principle behind a closely related language called Julia, which is also available within SageMathCloud but is much newer (and hence less established) than Python.