Backend
Cross-Layer Characterization and AI-Assisted Diagnosis of C-to-Rust Performance
arXiv cs.SE0 views
arXiv:2611.33490v1 Announce Type: cross Abstract: Migrating C code to Rust can significantly improve software security, but understanding the performance implications of such migrations remains challenging. While Rust is often claimed to match C's performance, runtime safety checks, compiler optimizations, and hardware microarchitecture interact in ways that complicate performance diagnosis. We first conduct a systematic cross-layer characterization of 12 benchmarks comprising C implementations and their Rust counterparts. Our study reveals that runtime safety checks do not necessarily dominate performance overhead, as compiler and microarchitectural optimizations often mitigate their costs. Across 8 of the 12 benchmarks, at least one Rust implementation performs within 10% of its C counterpart or outperforms it. Motivated by these findings, we introduce FerroScope, an AI-assisted performance debugger that integrates source-level analysis, compiler optimization remarks, dynamic instruction traces, and hardware performance counters to diagnose performance differences between C and Rust. FerroScope reproduces our manual findings while providing more precise explanations in several cases, including identifying compiler optimizations inhibited by redundant bounds checks. Guided by these diagnoses, we develop an LLVM compiler pass that hoists redundant bounds checks through guarded loop versioning while preserving Rust's panic behavior. The pass enables downstream compiler optimizations, including loop unrolling and conditional-move conversion, reducing Selection Sort's overhead from 2.95x to 1.00x and improving Merge Sort from 1.43x to 0.91x relative to C. Together, our results demonstrate how cross-layer performance characterization and AI-assisted diagnosis can guide safety-preserving compiler optimizations for efficient C-to-Rust migration.
Source:https://arxiv.org/abs/2611.33490PreviousDesigning an Integrated Learning Ecosystem for Introductory Python Programming: Scaffolded Problem Solving, Tablet-Inspired Navigation, and AI-Enhanced InstructionNextHow Much Effort Does an AI Code Reviewer Need? Evidence from Claude 5.5 Models on Plausible-but-Wrong Patches
Related posts

I turned a Meta Quest 3 into a tracing projector – and spent most of the time making one image stand still
0dev.to
Building a Zero-Backend Video Downloader Chrome Extension with Manifest V3 and FFmpeg WASM
0dev.to
6,307 lines of comments in 72,683 lines of code, 101 of them in JSDoc syntax, and not a single @param
0dev.to
How to Put a WordPress Site in Maintenance Mode
0dev.to
One API key for Seedance, Kling and Veo: a worked example in Node.js and Python
0dev.to

Frame Transactions Shift Direction, Fluidkey’s $1,6M Hack, Glamsterdam Slips to 2027, Lattice Security in Question
0dev.to