Practical Performant Programming for Humans
Micha Gorelick, Ian Ozsvald
Python#
Machine_learning#
Cython#
Docker#
NumPy#
Polars#
Dask#
👌 اگر کد پایتون شما درست اجرا میشود، اما نیاز دارید سریعتر اجرا شود، چه باید کرد؟
این کتاب کاربردی به شما نشان میدهد چگونه گلوگاههای عملکردی (Performance Bottlenecks) را شناسایی کنید و کد خود را در برنامههایی با حجم داده بالا بهطور چشمگیری سریعتر کنید. با توضیح نظریهی بنیادین پشت انتخابهای طراحی، ویرایش توسعهیافتهی High Performance Python به برنامهنویسان باتجربه کمک میکند درک عمیقتری از پیادهسازی پایتون به دست آورند.
⚡ چگونه از معماریهای چندهستهای (Multicore) یا کامپایلکردن بهره ببریم؟
یا سیستمی بسازیم که فراتر از محدودیت RAM عمل کند یا حتی با GPU اجرا شود؟ نویسندگان Micha Gorelick و Ian Ozsvald راهحلهای عملی برای بسیاری از این چالشها ارائه میدهند و تجربههای واقعی شرکتهایی را نقل میکنند که از پایتون پرفورمنس بالا برای استخراج دادههای GenAI، یادگیری ماشینی در سطح تولید (Productionized ML) و موارد دیگر استفاده کردهاند.
📊 آنچه در این کتاب یاد میگیرید:
📈 تسلط بیشتر بر NumPy، Cython و ابزارهای Profiler
🖥️ درک اینکه پایتون چگونه معماری سختافزار زیرین را انتزاع میکند
⏱️ استفاده از پروفایلینگ برای یافتن گلوگاههای زمانی CPU و مصرف حافظه
🗂️ نوشتن برنامههای بهینه با انتخاب ساختار دادهی مناسب
➗ شتابدادن به محاسبات ماتریسی و برداری
📑 پردازش سریعتر DataFrameها با Pandas، Dask و Polars
🤖 افزایش سرعت شبکههای عصبی و محاسبات GPU
🛠️ استفاده از ابزارها برای کامپایل پایتون به کد ماشین (Machine Code)
🔀 مدیریت همزمان عملیاتهای I/O و محاسباتی
☁️ تبدیل کد چندپردازشی (Multiprocessing) برای اجرا روی خوشههای محلی یا راهدور
Your Python code may run correctly, but what if you need it to run faster? This practical book shows you how to locate performance bottlenecks and significantly speed up your code in high-data-volume programs. By explaining the fundamental theory behind design choices, this expanded edition of High Performance Python helps experienced Python programmers gain a deeper understanding of Python's implementation.
How do you take advantage of multicore architectures or compilation? Or build a system that scales up beyond RAM limits or with a GPU? Authors Micha Gorelick and Ian Ozsvald reveal concrete solutions to many issues and include war stories from companies that use high-performance Python for GenAI data extraction, productionized machine learning, and more.
Table of Contents
Chapter 1. Understanding Performant Python
Chapter 2. Profiling to Find Bottlenecks
Chapter 3. Lists and Tuples
Chapter 4. Dictionaries and Sets
Chapter 5. Iterators and Generators
Chapter 6. Matrix and Vector Computation
Chapter 7. Pandas, Dask, and Polars
Chapter 8. Compiling to C
Chapter 9. Asynchronous 1/0
Chapter 10. The multiprocessing Module
Chapter 11. Clusters and Job Queues
Chapter 12. Using less RAM
Chapter 13. lessons from the Field
Micha Gorelick has worked as a machine learning researcher and engineer for The Markup and OCCRP. She was the co-founder of an applied machine learning company, Fast Forward Labs and authored the book ÂHigh Performance Python. She has worked as the lead researcher on a variety of cutting-edge research projects on topics ranging from neural networks for text summarization, probabilistic programming for understanding housing prices and various machine learning approaches for journalism.
Ian Ozsvald is a chief data Scientist and coach. He co-organizes the annual PyDataLondon conference with 700+ attendees and the associated 15,000+ member monthly meetup. He runs the established Mor Consulting data science consultancy in London and gives conference talks internationally, often as keynote speaker. He has 26 years of experience as a senior data science leader, trainer, and team coach. Noting the absence of advice for senior leaders he established the RebelAI data science leadership community in 2023, having helped many clients at a strategic level since 2015. For fun, he's walked by his high-energy Springer Spaniel, surfs the Cornish coast, and drinks fine coffee. Past talks and articles can be found at https://ianozsvald.com.