HyperPB: A Blazing-Fast Go Protobuf Parser Outperforming UPB

2025-07-24
HyperPB: A Blazing-Fast Go Protobuf Parser Outperforming UPB

This article introduces HyperPB, a remarkably fast Protobuf parser written in Go. Building upon the strengths of UPB (one of the fastest Protobuf runtimes), HyperPB leverages Go's register ABI and lack of undefined behavior for significant optimizations. Employing JIT compilation and online PGO, it surpasses both Protobuf Go's generated code and vtprotobuf in benchmark tests. At its core is a table-driven interpreter, enhanced with clever optimizations like zero-copy techniques, hot/cold data splitting, and arena reuse.

Read more
Development

Go's GC: A Deep Dive and a Custom Arena Allocator

2025-04-21
Go's GC: A Deep Dive and a Custom Arena Allocator

This article delves into the intricacies of Go's garbage collection and leverages that knowledge to build a high-performance arena allocator. By cleverly exploiting Go's GC behavior, the author achieves faster memory allocation than Go's built-in allocator, especially for large-scale allocations. The article details the design principles, implementation, and benchmark results of the custom arena allocator, also analyzing its performance in high-concurrency environments.

Read more
Development Memory Allocation

Target Triples: A Guide to Compiler Chaos

2025-04-15
Target Triples: A Guide to Compiler Chaos

This article delves into the complexities of compiler target triples, such as x86_64-unknown-linux-gnu. It explains the components of a triple (architecture, vendor, OS, ABI) and reveals the differences between GCC and LLVM's handling of them. The article details the naming conventions for various architectures (x86, ARM, etc.), vendor and OS representation, and stresses the importance of consistency to avoid confusion. Ultimately, the author advises against inventing new target triple conventions when building new toolchains to facilitate cross-toolchain collaboration.

Read more
Development target triples