Rust arena를 활용해 Gleam의 성능 이슈를 해결한 사례.
Gleam 포매터에서 3년간 지속된 성능 개선 이슈가 Rust arena를 통해 해결되었습니다. 재귀적 Document 구조에서의 개별 힙 할당을 arena 기반 참조로 대체하였고, 이를 통해 메모리 사용을 최적화했습니다. 또한, Box<Self>를 arena에 저장된 &Self로 변경하고 Rust의 수명 검사를 활용하여 안정성을 높였습니다.
Resolved performance issues in Gleam using Rust arena.
The performance issues that persisted for three years in the Gleam formatter have been resolved using Rust arena. Individual heap allocations in the recursive Document structure were replaced with arena-based references, optimizing memory usage. Additionally, Box<Self> was swapped out for &Self stored in the arena, utilizing Rust's lifetime checks for enhanced safety.