Language Compilation Speed (2021)
The article examines Rust's compilation speed compared to C/C++, noting frustrations among developers. It proposes a benchmarking method, revealing GCC compiles at 5,000 lines per second and Clang at 4,600.
Read original articleThe article discusses the compilation speed of various programming languages, particularly focusing on Rust and its comparison with C/C++. It highlights the common frustration among Rust developers regarding slow compilation times, especially when compared to faster languages like JavaScript and Python. The author proposes a benchmarking method that involves measuring how quickly different compilers can compile their own source code, acknowledging the inherent challenges in making direct comparisons due to differences in compiler design and implementation. The benchmarks are conducted on a Ryzen 2400G processor, measuring lines compiled per second. Initial results indicate that GCC compiles at approximately 5,000 lines per second, while Clang compiles at around 4,600 lines per second. The article emphasizes that these figures are not definitive due to various confounding factors in the compilation process. The author also notes the complexity of creating a fair benchmark, given the unique characteristics of Rust's type system and memory management compared to C/C++. Ultimately, the article aims to provide insights into the trade-offs between compilation speed and other factors in programming languages.
- Rust's compilation speed is often criticized, especially by developers accustomed to faster languages.
- The benchmarking method involves measuring how quickly compilers compile their own code.
- Initial results show GCC compiles at about 5,000 lines per second, while Clang is at 4,600 lines per second.
- The comparison is complicated by differences in compiler design and the nature of the code being compiled.
- The article highlights the need for better benchmarks to understand compilation speed across languages.
Related
Spending too much time optimizing for loops
Researcher Octave Larose shared insights on optimizing Rust interpreters, focusing on improving performance for the SOM language. By enhancing loop handling and addressing challenges, significant speedups were achieved, balancing code elegance with efficiency.
I Probably Hate Writing Code in Your Favorite Language
The author critiques popular programming languages like Python and Java, favoring Elixir and Haskell for immutability and functional programming benefits. They emphasize personal language preferences for hobby projects, not sparking conflict.
Beating the Compiler
The blog post discusses optimizing interpreters in assembly to outperform compilers. By enhancing the Uxn CPU interpreter, a 10-20% speedup was achieved through efficient assembly implementations and techniques inspired by LuaJIT.
I Hope Rust Does Not Oxidize Everything
The author expresses concerns about Rust's widespread adoption in programming, citing issues with syntax, async features, complexity, and long compile times. They advocate for language diversity to prevent monoculture, contrasting Rust with their language Yao.
Rustgo: Calling Rust from Go with near-zero overhead
An experiment explores calling Rust code from Go to enhance performance in critical applications. It proposes linking Rust directly into Go, avoiding cgo overhead, and details calling conventions for efficient integration.
Related
Spending too much time optimizing for loops
Researcher Octave Larose shared insights on optimizing Rust interpreters, focusing on improving performance for the SOM language. By enhancing loop handling and addressing challenges, significant speedups were achieved, balancing code elegance with efficiency.
I Probably Hate Writing Code in Your Favorite Language
The author critiques popular programming languages like Python and Java, favoring Elixir and Haskell for immutability and functional programming benefits. They emphasize personal language preferences for hobby projects, not sparking conflict.
Beating the Compiler
The blog post discusses optimizing interpreters in assembly to outperform compilers. By enhancing the Uxn CPU interpreter, a 10-20% speedup was achieved through efficient assembly implementations and techniques inspired by LuaJIT.
I Hope Rust Does Not Oxidize Everything
The author expresses concerns about Rust's widespread adoption in programming, citing issues with syntax, async features, complexity, and long compile times. They advocate for language diversity to prevent monoculture, contrasting Rust with their language Yao.
Rustgo: Calling Rust from Go with near-zero overhead
An experiment explores calling Rust code from Go to enhance performance in critical applications. It proposes linking Rust directly into Go, avoiding cgo overhead, and details calling conventions for efficient integration.