pyo3-performance-patterns

Official

Optimize Python/Rust async performance

Authorkreuzberg-dev
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses performance bottlenecks when integrating asynchronous Rust code with Python, particularly concerning GIL management and efficient callback handling.

Core Features & Use Cases

  • Async Callback Optimization: Leverages pyo3_async_runtimes for significantly faster async Python callbacks compared to spawn_blocking.
  • GIL Management: Provides patterns for releasing the GIL before awaiting async operations and using Python::attach() appropriately.
  • Use Case: When calling a Rust function from Python that involves asynchronous operations, this Skill ensures the most performant and deadlock-free execution path is chosen based on whether the operation is quick or long-running.

Quick Start

Use the pyo3-performance-patterns skill to optimize an async Python callback by releasing the GIL before awaiting.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: pyo3-performance-patterns
Download link: https://github.com/kreuzberg-dev/html-to-markdown/archive/main.zip#pyo3-performance-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.