Unleashing the Efficiency of Rust: An Empirical Study of Performance Bugs in Rust Projects

Rust is a system programming language that emphasizes both efficiency and memory safety. It achieves comparable efficiency with C/C++ by pursuing the concept of zero-cost abstraction and memory safety via its ownership scheme. As a side effect, these features may also steepen the learning curve for...

Full description

Saved in:
Bibliographic Details
Published in:Proceedings - International Symposium on Software Reliability Engineering pp. 371 - 381
Main Authors: Cui, Chenhao, Xu, Hui
Format: Conference Proceeding
Language:English
Published: IEEE 21.10.2025
Subjects:
ISSN:2332-6549
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:Rust is a system programming language that emphasizes both efficiency and memory safety. It achieves comparable efficiency with C/C++ by pursuing the concept of zero-cost abstraction and memory safety via its ownership scheme. As a side effect, these features may also steepen the learning curve for developers, potentially leading to the use of inefficient code in their programs. In this paper, we aim to investigate the characteristics of performance bugs that occur in real-world Rust projects. To this end, we have mined the repository of 100 well-known projects on GitHub and collected 114 performance bugs. We manually audit each case and find 8 optimization patterns unique to Rust, including three types of checking, two types of cloning, and three types of data collection. We have further designed a static analyzer for Rust-specific patterns and evaluated it through two complementary experiments: (1) a controlled micro-benchmark across 48 cases, demonstrating strong detection capability for optimizable patterns like bounds checking, and (2) a large-scale validation on 5 real-world projects (7k functions, 50K LOC) confirming practical applicability. The results advocate a tiered optimization strategy: automated fixes for less context-sensitive patterns and developer-guided solutions for complex cases like cloning. We hope our work can enhance the usability of Rust's complex yet powerful language features, empowering developers to write safe, high-performance code more efficiently.
ISSN:2332-6549
DOI:10.1109/ISSRE66568.2025.00045