Hands-on: Adding static typing to heat equation
In this exercise, we create a Cython extension for the heat equation solver and add static typing.
The code for this exercise is located under
Creating a Cython extension
Based on the profile in the performance measurement exercise
setup.py for creating a Cython module for the most time consuming part of the heat equation solver.
If you did not finish the profiling exercise, you can look at example profile here.
Insert static type declarations to proper locations. Investigate the effect on performance. You
can use applications own timers and/or timeit. Annotated HTML-report with
cython –a … can be useful when tuning performance.
Please comment how much speedup you could get!
© CC-BY-NC-SA 4.0 by CSC - IT Center for Science