17
Extensions in C/C++, System Calls, and C/C++ Libraries
The last few chapters have shown us many machine learning and scientific computing libraries. Many of these libraries are not written in pure Python because of code reuse from existing libraries, or for performance reasons. In this chapter, we will learn how we can do some of this ourselves by creating C/C++ extensions.
In Chapter 12, Performance – Tracking and Reducing Your Memory and CPU Usage, we saw that the cProfile
module is about 10 times faster than the profile
module, which indicates that at least some C extensions are faster than their pure Python equivalents. This chapter will not focus on performance that much, however. The goal here is interaction with non-Python libraries. ...
Get Mastering Python - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.