Writing Python Bindings for C++ Libraries: Easy-to-use Performance - Saksham Sharma - CppCon 2023

  Рет қаралды 6,975

CppCon

CppCon

2 ай бұрын

cppcon.org/
---
Writing Python Bindings for C++ Libraries: Easy-to-use Performance - Saksham Sharma - CppCon 2023
github.com/CppCon/CppCon2023
The unix philosophy encourages writing small applications that compose well, and unix / linux / sh have provided us with nice chaining tools that let us achieve this. This works well enough, but chaining of processes makes it complicated to actually share memory space, library versions, and memory layouts of various objects. Working within a single programming language (Python for instance), we can script and keep local memory state and chain together things however we like. Think of numpy or pandas as examples.
In this talk we will discuss how we can use boost::python and friends to help us build our C++ libraries as dynamically linked libraries that can be exposed safely as python functions and objects in python programs. This will be done entirely in C++, with Python being the equivalent of a shell for us (helping us invoke our library's methods).
We will use some real-world-inspired examples of libraries as case studies to explore how to design the user facing API for such software, and what kind of nuances to think about while doing so. As a result, the attendees will learn how to go about designing python bindings for their own applications, and how to consider the performance implications of each design choice.
We will discuss, among other things, the following topics:
1. Managing memory to inter-op smoothly with Python, which is garbage collected
2. Inter-operability and conversion between C++ and python data containers
3. Handling multiple threads and background processing
4. Sharing data and pointers across modules
5. Ensuring build system consistency to avoid incompatibility across build environments
6. Some common API design ideas tried and tested in actual applications.
---
Saksham Sharma
Saksham Sharma is a Director of Quantitative Research Technology at Tower Research Capital LLC, a high frequency trading firm based out of New York. He develops low latency and high throughput trading systems and strategies used for the firm's global quantitative trading. In addition, he also helps design and improve big data research infrastructure used for trading research using a combination of C++ and Python. Thanks to an urge to optimize his daily workflow, he also owns the build systems, tooling, and package managers for C++ within his team.In the past, he has worked in the fields of program analysis research, functional programming, and systems security. He is a reformed geek (exemplified by a switch to VSCode after almost a decade with Emacs), and now enjoys driving, guitar, badminton, and snowboarding.
---
Videos Filmed & Edited by Bash Films: www.BashFilms.com
KZbin Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
Registration for CppCon: cppcon.org/registration/
#cppcon #cppprogramming #cpp #python

Пікірлер: 3
@QianliMa_robot
@QianliMa_robot Ай бұрын
10:41 show a really good slide summarizing all the available ways to speed up python.
@user-rq9rl1hs4j
@user-rq9rl1hs4j 2 ай бұрын
😢😢
La final estuvo difícil
00:34
Juan De Dios Pantoja
Рет қаралды 26 МЛН
How to write SOLID C++
29:22
platis.solutions
Рет қаралды 36 М.
Back to Basics: Testing in C++ - Phil Nash - CppCon 2023
1:02:33
#miniphone
0:18
Miniphone
Рет қаралды 9 МЛН
Полный обзор iPad Pro M4 - хвалю!
26:27
Rozetked
Рет қаралды 208 М.
M4 iPad Pro Impressions: Well This is Awkward
12:51
Marques Brownlee
Рет қаралды 6 МЛН
ПК с Авито за 3000р
0:58
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,2 МЛН
Very Best And Good Price Smart Phone
0:42
SDC Editing Zone 9K
Рет қаралды 217 М.
Nokia 3310 versus Red Hot Ball
0:37
PressTube
Рет қаралды 3,1 МЛН