@charliermarsh: TIL that #[serde(flatten)] can have meaningful overhead, since all fields not explicitly declared on the outer struct a…
Summary
A developer observes that serde's #[serde(flatten)] can have meaningful performance overhead because fields not explicitly declared on the outer struct are buffered.
View Cached Full Text
Cached at: 08/04/26, 06:03 AM
TIL that #[serde(flatten)] can have meaningful overhead, since all fields not explicitly declared on the outer struct are buffered https://t.co/uP4hwJO4P7
Similar Articles
Rust's derive often implies inline
A Rust "Today I Learned" post explaining that the #[derive(...)] macro implicitly emits #[inline] on generated trait implementations (e.g., Debug, Default), which can bloat code size when derived implementations of large structs are invoked repeatedly.
Closing a three-year-old issue using Rust arenas
A Gleam core team member improved the language's pretty printer performance by replacing boxed documents with arena-allocated references, reducing peak memory usage by 10% and closing a three-year-old issue.
@TaKOBKi: My latest rustc PR introduces adaptive sparse encoding for metadata tables. Rustc-perf results show a 20.18% average re…
A new rustc PR introduces adaptive sparse encoding for metadata tables, achieving an average 20.18% reduction in crate metadata size according to rustc-perf results.
Cache-Conscious Data Layout in Rust: Field Zoning, False Sharing, 128-Byte Rule
This blog post explains cache-conscious data layout in Rust for multi-threaded structures, covering field zoning and the 128-byte rule to avoid false sharing, using an SPSC ring buffer as an example.
It's all about the allocator
A blog post arguing that memory efficiency hinges on allocators, showing how AI-generated Rust code often wastes memory (per-frame allocations, cloning) and demonstrating proper buffer-reuse techniques instead.