Speed Up Your Python with Rust: Optimize Python performance by creating Python pip modules in Rust with PyO3

0
(0)

Speed Up Your Python with Rust: Optimize Python performance by creating Python pip modules in Rust with PyO3
 

  • Author:Maxwell Flitton
  • Length: 384 pages
  • Edition: 1
  • Publisher: Packt Publishing
  • Publication Date: 2022-01-21
  • ISBN-10: 180181144X
  • ISBN-13: 9781801811446
  • Sales Rank: #3629709 (See Top 100 Books)
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Discover how to inject your code with highly performant Rust features to develop fast and memory-safe applications

    Key Features

    • Learn to implement Rust in a Python system without altering the entire system
    • Write safe and efficient Rust code as a Python developer by understanding the essential features of Rust
    • Build Python extensions in Rust by using Python NumPy modules in your Rust code

    Book Description

    Python has made software development easier, but it falls short in several areas including memory management that lead to poor performance and security. Rust, on the other hand, provides memory safety without using a garbage collector, which means that with its low memory footprint, you can build high-performant and secure apps relatively easily. However, rewriting everything in Rust can be expensive and risky as there might not be package support in Rust for the problem being solved. This is where Python bindings and pip come in.

    This book will help you, as a Python developer, to start using Rust in your Python projects without having to manage a separate Rust server or application. Seeing as you’ll already understand concepts like functions and loops, this book covers the quirks of Rust such as memory management to code Rust in a productive and structured manner. You’ll explore the PyO3 crate to fuse Rust code with Python, learn how to package your fused Rust code in a pip package, and then deploy a Python Flask application in Docker that uses a private Rust pip module. Finally, you’ll get to grips with advanced Rust binding topics such as inspecting Python objects and modules in Rust.

    By the end of this Rust book, you’ll be able to develop safe and high-performant applications with better concurrency support.

    What you will learn

    • Explore the quirks of the Rust programming language that a Python developer needs to understand to code in Rust
    • Understand the trade-offs for multiprocessing and thread safety to write concurrent code
    • Build and manage a software project with cargo and crates
    • Fuse Rust code with Python so that Python can import and run Rust code
    • Deploy a Python Flask application in Docker that utilizes a private Rust pip module
    • Inspect and create your own Python objects in Rust

    Who this book is for

    This book is for Python developers who want to speed up their Python code with Rust and implement Rust in a Python system without altering the entire system. You’ll be able to learn about all topics relating to Rust programming. Basic knowledge of Python is required to get the most out of this book.

    中文:

    书名:Speed Up Your Python with Rust: Optimize Python performance by creating Python pip modules in Rust with PyO3

    了解如何使用高性能的RUST特性注入代码,以开发快速且内存安全的应用程序

    主要特点

    • 了解如何在不更改整个系统的情况下在Python系统中实现Rust
    • 通过了解Rust的基本特性,以Python开发人员的身份编写安全高效的Rust代码
    • 通过在Rust代码中使用Python NumPy模块在Rust中构建Python扩展

    图书描述

    Python使软件开发变得更容易,但它在包括内存管理在内的几个方面存在不足,导致性能和安全性较差。另一方面,Ruust在不使用垃圾收集器的情况下提供内存安全,这意味着凭借其较低的内存占用,您可以相对轻松地构建高性能和安全的应用程序。然而,在Rust中重写一切可能是昂贵和有风险的,因为在Rust中可能没有对正在解决的问题的包支持。这就是Python绑定和pip的用武之地。

    作为一名Python开发人员,本书将帮助您开始在您的Python项目中使用Rust,而不必管理单独的Rust服务器或应用程序。鉴于您已经了解了函数和循环等概念,这本书涵盖了Rust的怪癖,例如以高效和结构化的方式对Rust进行编码的内存管理。您将探索Py03机箱以将Rust代码与Python融合,学习如何将融合的Rust代码打包到PIP包中,然后在Docker中部署使用私有Rust PIP模块的Python Flask.最后,您将了解高级的Rust绑定主题,例如检查Rust中的Python对象和模块。

    到本书结束时,您将能够开发具有更好的并发支持的安全、高性能的应用程序。

    你将学到什么

    • 探索Rust编程语言的怪癖,Python开发人员需要了解这些语言才能用Rust编写代码
    • 了解多处理和线程安全之间的权衡,以编写并发代码
    • Build and manage a software project with cargo and crates
    • 将Rust代码与Python融合,以便Python可以导入和运行Rust代码
    • 在Docker中部署使用私有Rust pip模块的Python FlaskTM应用程序
    • 在Rust中检查并创建您自己的Python对象

    这本书是为谁而写的

    这本书是为那些希望在不改变整个系统的情况下使用Rust来加速他们的Python代码并在一个Python系统中实现Rust的Python开发人员而写的。您将能够学习与Rust编程相关的所有主题。要最大限度地了解本书,需要掌握有关Python的基本知识。

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册