iCreatAI News
Skip to content
Hacker News AI· lucamark·· 9 hr agoAI score34

Cross-Layer Characterization and AI-Assisted Diagnosis of C-to-Rust Performance

Cross-Layer Characterization and AI-Assisted Diagnosis of C-to-Rust Performance

AI summary

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.

Source: Hacker News AI · arxiv.org