Treffer: Fast native data structures: C/C++ from Python

Title:
Fast native data structures: C/C++ from Python
Contributors:
Marc-Andre Lemburg
Publisher Information:
EuroPython Conference
Publication Year:
2021
Document Type:
course material<br />moving image (video)
Language:
English
Accession Number:
edsbas.78247F0D
Database:
BASE

Weitere Informationen

(en)Python has very fast and thoroughly optimised data structures: lists, dicts, sets and the collections module make it easy to write simple code that performs well. The flip-side shows when it comes to processing very large amounts of simple data, especially numbers or strings. For these, the object overhead of Python's objects is very large in comparison to the low-level languages C and C++ that benefit directly from bare metal CPU performance as well as from GIL-free multi-threading and parallel computation. This talk will show how compiling your Python code with Cython enables you to make direct use of fast and memory efficient native data types and data structures. Cython provides very efficient ways to access the internals of Python data structures, process data from NumPy arrays, and use data structures from native C libraries or the C++ STL standard library as replacements for the high-level Python collections. You will learn how you can implement high-level Python interfaces that enable fast data processing underneath, without sacrificing the integration with regular Python features and libraries to allow for easy direct data manipulation from Python code.