Origami Speed Championships: Fast Polygon Triangulation in Python
- Track:
- Jupyter and Scientific Python
- Type:
- Talk (long session)
- Level:
- intermediate
- Duration:
- 45 minutes
Abstract
Sometimes the code that you use works, but is too slow. Yet, the source of the problem is not clear.
In this talk, you’ll learn how we identified performance bottlenecks in our shape-handling code and applied various techniques to accelerate it. We’ll walk through the entire process: reducing algorithm complexity, leveraging Numba’s JIT compiler, building compiled prototypes in Cython and C++, and ultimately implementing a Rust-based solution
Along the way, we'll discuss the unique challenges of optimizing performance for interactive applications, focusing on how we reduced latency in the napari GUI.
Topics covered:
Identifying performance bottlenecks (profiling techniques, real-world case study) Optimizing Python code (NumPy considerations, algorithm improvements) Just-in-time compilation (Numba’s strengths and weaknesses) When and how to use compiled extensions (Cython, C++, Rust) Challenges of optimizing interactive applications (napari GUI case study)
"This talk is aimed at Python developers who want to optimize numerical code, whether for scientific computing, interactive applications, or general performance improvements."