Click any tag below to further narrow down your results
Links
This article presents key performance numbers every Python programmer should know, including operation latencies and memory usage for various data types. It features detailed tables and graphs to help developers understand performance implications in their code.
This article explores how Python allocates memory for integers, revealing that every integer is represented as a heap-allocated object in CPython. The author conducts experiments to measure allocation frequency during arithmetic operations, discovering optimizations that reduce unnecessary allocations. Despite these efficiencies, the article highlights performance overhead and suggests potential improvements.
This article examines five methods for inserting data into PostgreSQL using Python, focusing on the trade-offs between performance, safety, and convenience. It highlights when to prioritize speed and when clarity is more important, helping you select the best tool for your specific data requirements.
Cloudflare has improved its Python Workers platform by adding support for a wider range of packages and implementing faster cold start times. The article explains how to deploy a FastAPI app globally in minutes and highlights performance benchmarks against AWS Lambda and Google Cloud Run.
This article outlines ten effective strategies to optimize Python code for better performance. It covers techniques like using sets for membership testing, avoiding unnecessary copies, and leveraging local functions to reduce execution time and memory usage. Each hack is supported by code examples and performance comparisons.
This article dissects Anthropic's recently released take-home exam for performance optimization, which aims to engage candidates through an enjoyable challenge. It covers the simulated hardware, algorithm optimization techniques, and the data structures involved in the task, making it accessible even for those without a strong background in the field.
This article argues that Clojure may rival Python in the Data Science field due to its general-purpose nature, strong performance on the JVM, and rich library ecosystem. It highlights how Clojure's advantages address Python's limitations, particularly in speed and interop with native code.
This article covers a technical project focused on speeding up the creation and deployment of container images across multiple nodes. It also discusses optimizing Python imports by leveraging undocumented features for bytecode caching.
This article details improvements made to the Python packaging library, focusing on optimizing version and specifier handling. Key enhancements resulted in reading versions up to 2x faster and specifier sets up to 3x faster, significantly boosting performance for tools like pip. The author shares insights into the profiling and benchmarking methods used during this work.
This article explores how WebAssembly (Wasm) can be used to extend Python applications, allowing developers to write performance-critical code in any Wasm-compatible language. It discusses the advantages of using wasmtime-py over other runtimes and highlights common pitfalls when interfacing between Python and Wasm.
Purem is a high-performance computation engine that enhances Python's speed for machine learning applications, offering 100-500x acceleration compared to existing libraries like NumPy and PyTorch. By optimizing operations at a low hardware level with zero Python overhead, Purem addresses bottlenecks in traditional ML workflows, enabling faster execution and seamless integration into existing codebases. It is designed for modern hardware and can significantly reduce computation times for various applications, from fintech to big data processing.
UV is a new package manager developed by Astral that addresses the slow performance issues of traditional Python packaging by utilizing innovative techniques such as a static Rust binary, SAT-solving dependency resolution, and optimized installation processes. These advancements lead to significant speed improvements, enabling developers to create virtual environments quickly and streamline their workflows, ultimately allowing them to focus more on coding rather than managing dependencies.
Pyrefly is a fast type checker and language server for Python that offers powerful IDE features, enabling users to type check over 1.85 million lines of code per second. It provides instant feedback and lightning-fast autocomplete, enhancing the development experience. Users can connect on Discord for support and share feedback.
To efficiently insert large datasets into a Postgres database, combining Spark's parallel processing with Python's COPY command can significantly enhance performance. By repartitioning the data and utilizing multiple writers, the author was able to insert 22 million records in under 14 minutes, leveraging Postgres's bulk-loading capabilities over traditional JDBC methods.
Telemetry Harbor transitioned its data ingest pipeline from Python to Go to enhance performance and scalability. The move was driven by the need for improved concurrency and lower latency in processing large volumes of data. This rewrite aims to better meet the growing demands of their services and improve overall efficiency.
The article discusses Python's CPU caching mechanisms and their impact on performance optimization. It highlights how effective caching can significantly reduce execution time and improve the efficiency of Python applications. Various strategies and best practices for implementing caching in Python are also explored to help developers enhance their code's performance.
Python data science workflows can be significantly accelerated using GPU-compatible libraries like cuDF, cuML, and cuGraph with minimal code changes. The article highlights seven drop-in replacements for popular Python libraries, demonstrating how to leverage GPU acceleration to enhance performance on large datasets without altering existing code.
The article discusses the integration of Python with WebAssembly, allowing developers to run Python code in edge environments. This capability enhances performance and flexibility, enabling the execution of Python applications closer to users for improved responsiveness. The piece highlights the advantages and potential use cases of this technology in modern web development.
Python 3.14 has been officially released, showcasing significant speed improvements over its predecessors, particularly in single-threaded performance. Benchmarks conducted on various Python interpreters indicate that while Python 3.14 is faster than earlier versions, it still falls short of native code performance seen in languages like Rust and Pypy. The results highlight ongoing development in Python performance, but also caution against over-reliance on generic benchmarks for performance assessments.
The article discusses the significant improvements in Python 3.14, particularly the advancements in the free-threaded variant that eliminates the Global Interpreter Lock (GIL) and enhances performance for web services. The author compares benchmarks between ASGI and WSGI applications using popular frameworks FastAPI and Flask to highlight the benefits of the GIL-free implementation for web development.