PyData Global 2025

Supercharge your Python performance with FFIs for AI workflows
2025-12-11 , Machine Learning & AI

Python is the go-to language in AI for its simplicity, but it often struggles with heavy computations due to the Global Interpreter Lock (GIL). This talk shows how Foreign Function Interfaces (FFIs) like Cython, ctypes, cffi, and PyO3 can dramatically enhance Python performance by calling native C, C++, or Rust code. Attendees will learn to identify bottlenecks, apply FFIs effectively, and accelerate AI and data science workflows.


Python is tremendously popular in the AI and data science space thanks to its simplicity and rich library support. However it often struggles with performance on heavy computations. A major limitation is the Global Interpreter Lock (GIL) which restricts Python to one thread at a time even on multi‑core processors. This leads to slowdowns for CPU‑bound tasks .
Foreign Function Interfaces (FFIs) can provide a practical solution to this issue. Open source libraries like Cython, ctypes, cffi, and PyO3 let Python call fast native code written in C C++ or Rust. By offloading performance‑critical sections such as vector ops data encoding or math kernels to native code developers can significantly boost performance while keeping most of the program in easy‑to‑reading Python itself. This performance boost can drastically reduce LLM data €processing time and make the process so much seamless for the developers.

In this talk attendees will learn:
- How the GIL limits parallel performance and why this matters
- When and why to use FFIs covering Cython ctypes cffi and PyO3
- Live examples and benchmarks showing dramatic run time reductions
- Key trade‑offs around call overhead memory conversions and packaging
- Leverage FFIs while building your GenAI workflows

By attending this session attendees will know how to identify performance bottlenecks and apply the right FFI based approach to speed up their workflows. Whether you are working on AI pipelines, real‑time systems or data tools this talk will equip you to make Python perform at scale.


Prior Knowledge Expected:

No

Shivay Lamba is a software developer specializing in DevOps, Machine Learning and Full Stack Development.

He is an Open Source Enthusiast and has been part of various programs like Google Code In and Google Summer of Code as a Mentor and has also been a MLH Fellow.
He is actively involved in community work as well. He is a TensorflowJS SIG member, Mentor in OpenMined and CNCF Service Mesh Community, SODA Foundation and has given talks at various conferences like Github Satellite, Voice Global, Fossasia Tech Summit, TensorflowJS Show & Tell.

Rudraksh Karpe is an GenAI Engineer at ZS Associates, building enterprise-grade Generative AI solutions with a strong focus on privacy and security. Rudraksh is a committed open-source contributor, having participated in Google Summer of Code at openSUSE Project with openSUSE. Rudraksh has spoken internationally at conferences such as openSUSE Conference 2025 Nuremberg, Germany, PyCon US 2025, openSUSE Asia Summit 2024 Tokyo, Japan and Conf KDE India, Pune.