UCLA and other research: C-to-Rust performance gap can mostly be kept within 10%
Understand this story
A UCLA and UC Davis team conducted a cross-layer performance characterization of 12 pairs of C and their Rust implementations, concluding that runtime safety checks are not the main cause of performance overhead: in 8 of the 12 pairs, at least one Rust implementation was within 10% of C or faster. The study was published by Dalton Davis, Kunal Pai, and Tapti Palit, and also includes the FerroScope debugger and an LLVM optimization pass for diagnosis.
AI overview based on source reports · Updated 9 hr ago
Coverage timeline
Follow the coverage to explore different perspectives.
- Hacker News AICross-Layer Characterization and AI-Assisted Diagnosis of C-to-Rust Performance
This paper presents a cross-layer characterization of 12 benchmarks comparing C implementations with manually translated Rust versions, finding that runtime safety checks do not necessarily dominate overhead and that in 8 of 12 benchmarks at least one Rust implementation came within 10% of C or outperformed it. The authors introduce FerroScope, an AI-assisted performance debugger combining source-level analysis, compiler optimization remarks, dynamic instruction traces, and hardware performance counters, which reproduced their manual findings and identified compiler optimizations inhibited by redundant bounds checks. Guided by these diagnoses, they develop an LLVM pass that hoists redundant bounds checks via guarded loop versioning while preserving Rust's panic behavior, reducing Selection Sort's overhead from 2.95× to 1.00× and improving Merge Sort from 1.43× to 0.91× relative to C.
Activity for this story
- Current comparable activity
- 8
- Peak comparable activity
- 10Nov 27 19:00
- Change in the past 24 hours
- –
Trends compare the same fully observed participants, which may cover fewer participants than current activity. Move the pointer or tap the chart to inspect hourly activity; use the left and right arrow keys with a keyboard.