Rust

Performance Optimization

Profiling, benchmarking, allocator strategies, zero-copy, SIMD, inline, codegen optimization

20 preguntas de entrevista·
Senior
1

Which tool generates flame graphs to visualize performance hotspots in a Rust program?

Respuesta

cargo-flamegraph is the standard tool for generating flame graphs from profiling data. It uses perf on Linux or dtrace on macOS to collect stack samples, then generates an interactive SVG visualization allowing quick identification of the most CPU-consuming functions.

2

Which crate is recommended for writing precise and statistically reliable micro-benchmarks in Rust?

Respuesta

Criterion is the reference crate for benchmarking in Rust. It provides robust statistical analysis, detects performance regressions between runs, generates HTML graphs, and automatically handles warm-up and iteration count to obtain reliable results.

3

What does the zero-cost abstraction concept mean in Rust?

Respuesta

Zero-cost abstractions mean that high-level abstractions (iterators, traits, generics) compile to machine code as efficient as manually written low-level code. The abstraction cost exists only at compile time (monomorphization), not at runtime.

4

Which attribute suggests the Rust compiler to inline a function?

5

Which Rust compilation option enables the maximum optimization level?

+17 preguntas de entrevista

Domina Rust para tu próxima entrevista

Accede a todas las preguntas, flashcards, tests técnicos, ejercicios de code review y simuladores de entrevista.

Empieza gratis