Is there a reason to learn Cython
Python optimization: Cython
The Python code is optimized. All tasks are parallelized, the CPUs all run at 99%. The database is optimized. The hardware is exhausted. Nevertheless, a factor of 30 still needs to be gained in computing time.
There are now only a few options:
- Different programming language / platform / framework
- Outsourcing of computing processes to the GPU
- Optimizing the Python code with Cython
If there is no other way left open:
- the first option is the worst. Your own development team either has to learn something completely new or new team members have to be laboriously integrated into the team.
- outsourcing processes to the GPU can bring about a huge increase in computing power (factor 100/1000) if the problem can be transformed accordingly. It should also be remembered that the corresponding GPU hardware / licenses have to be bought / managed. No chance without external specialists. The adjustments can then be made by yourself with trained developers.
- Optimization with Cython (factor 2-40) usually doesn't happen just like that. External specialists can quickly establish a knowledge transfer that enables in-house developers to optimize your existing code. The Cython optimization is also hardly dependent on the problem / hardware.
Course content:After a simple introduction to how Cython works, an algorithm given in Python (QuadTree) is ported piece by piece to Python.
With this port you will learn to find bottlenecks in your Python code. Because we show you which performance problems the Python / Numpy data structures suffer from.
Three points are specifically explored:
- Effective use of numpy arrays from within Cython with memory views
- "Cython extension types": Object-oriented Cython and its limits
- "Exception handling": How to route exceptions from Cython to Python.
After successfully completing this course, you should be able to do the following yourself with Cython:
Create high-performance subroutines
Even writing object-oriented Cython with "Extension types".
Have a generally better understanding of optimization.
- Why does body weight fluctuate
- What is the Mahesh Babu caste
- Does PSYCH K differ from hypnosis
- What is a non-participant observation
- What is atherosclerosis
- How many votes does Iowa have
- What are contraindications for drugs
- How to make a ball pit
- Paving stones can be laid on concrete
- What do scientists think of Bernardo Kastrup
- Who invented the rule of 72?
- What is freezing fog
- Why are there so many war films
- What is synthol
- Will Norway suffer from a hard Brexit?
- What are the best hotels in Brussels
- Where's the best sushi in Cincinnati
- Are Armenians and Greeks related to Phrygians
- What does subjective mean in medical terms
- You can apply to several renowned universities
- Should I love God, yes or no
- Army officers are useless
- What are the three types of courage
- How do you help your baby poop