Compilation speed obviously largely depends on hardware, and size of the project. I read below a comment that a 30MB project took about an hour to build. Considering it took me less than that to build the ENTIRE llvm github repo, that sounds mostly like a low end hardware problem (mind you my current hardware is like 8 years old and wasn't that special even then). That also largely has a lot to do with make/cmake, imo. I have noticed in some instances, where it isn't too much to just compile with gcc/clang manually, compile times are actually a little faster, since you don't have another abstraction from the compiler itself.
That brings me to another point, the compiler choice. That can also play a big role in compile times. In my experience so far, clang tends to be a tiny bit faster than gcc, but only after caches are loaded up. It's never by much, though I haven't personally worked on any real large C/C++ projects so I cannot really comment on those cases. I of course just ran cmake for the llvm build so I cannot give concrete numbers, only tendencies I've observed from various smaller-medium sized projects.
In regards to Rust, the slowness is not even so much the compiler itself as it is cargo. I literally just tested it before writing this paragraph. The time it took to compile the basic hello world program was 0.159 seconds with rustc, and 0.718 seconds on the first run of "cargo build". However, running cargo build for a SECOND time produced a compile time of 0.043 seconds, because the caches were loaded up. Contrasting that, rustc on its second run was 0.13 seconds.
So, a lot of it varies, however I can objectively say that on FIRST run of "cargo build", it is significantly slower than pretty much any compiler I have ever tried. That seems to be the price paid for the extra safety (and the convenience of cargo) so it's up to you what you find more important.
Let's be real here though. How unsafe a program is is ultimately up to those who developed it. It is perfectly possible to create "safe" programs in languages like C or C++, even languages like Python. If you cover your bases, you should be fine in just about any language. What makes Rust special when it comes to safety is the fact that it FORCES everything to be "safe", even when it doesn't make much sense.
At the end of the day, they're all good languages. Worrying about what language is the best is frankly just idiotic since they all have their pros and cons. Whatever works for you is amazing.
For those curious, I decided to test C and C++ too.
Hello world in C: cc – 0.193s gcc – 0.39s clang – 1.031s!!!! I ran clang a second time because wtf. Seems it needed the caches loaded too, because a secon run produced 0.058. So, an instance where clang was slower than gcc.
C++: g++ – 0.719!! Ran it again, got 0.261 clang++ – 0.390, much faster than g++ for the first run. The second run, 0.305, which was slightly slower than the g++ run.
Mind you, that is just hello world, but it is still very indicative of the variance involved in making compile times slow or fast. If it varies that much for such a simple program, that says a lot.
Why is everyone so much talking about compile speed , I can wait 10 days to compile , no issues , but I want my code ultra performance because once it's done that code will stay there until the next version rolled out .. who is making these nonsense videos .. those who say compile slowness I guess doing it on small laptops , sure . Those who don't have a workstation making this judgement
Can you give me detail number?
More than car speed
I'm watching this while my rust program is compiling because it is taking too long
What are you talking about. Rust won't even let you compile. It's going to complain about you borrowing first.
Python is like Arabs changing tires while driving
Python:
Common Lisp is missing in this video. They would have unscrewed the wheels of the car right on the move, added a wing and added a jet engine.
Html вошел в чат
Rust starts with first checking tyre prices online. 😀
When they named it rust
C++ is the best bro (Come back coding in Python)
Where is Python?
Python: changes tyre while moving
vlang: straight up doesn't need to change tires
Python: keeps driving while pitstop people are running
Python😂?
Zig is Redbull F1 car
checking both Go and Rust at the same time now. Rust really takes it time.
This comment section needs to learn the difference between compilation speed and running speed. Like jeez…
❤❤❤❤❤❤❤❤❤❤❤❤
rust is rusty.
wtf are u smoking lmao
Good things take time to be built 👍🏻
Rust doesn't even do caching…
You forgot Python, change tires by hand
you don't understand c++ or rust either, 😂this is very wrong
And what about performance?
RUST compiler disciplines you to write the bug free code in one way else….
Have you heard Rust multiple threads parallel compilation. It's available above rust 1.75.0
hey rust doesnt compile that blazingly fast. its a little slower than that
What about Zig?
Этот бро просто слишком сильно любит go. Хорошое продвижение для такого языка
Let me tell you about this wild concept called compile-time optimizations… all it requires is that you kind of know what you are doing!
Bro swap golang with c++ lol. Bro love golang
C++ car driver does not feel anything even though his tyre got punctured a long ago.. 😅😅😅
Compilation speed obviously largely depends on hardware, and size of the project. I read below a comment that a 30MB project took about an hour to build. Considering it took me less than that to build the ENTIRE llvm github repo, that sounds mostly like a low end hardware problem (mind you my current hardware is like 8 years old and wasn't that special even then). That also largely has a lot to do with make/cmake, imo. I have noticed in some instances, where it isn't too much to just compile with gcc/clang manually, compile times are actually a little faster, since you don't have another abstraction from the compiler itself.
That brings me to another point, the compiler choice. That can also play a big role in compile times. In my experience so far, clang tends to be a tiny bit faster than gcc, but only after caches are loaded up. It's never by much, though I haven't personally worked on any real large C/C++ projects so I cannot really comment on those cases. I of course just ran cmake for the llvm build so I cannot give concrete numbers, only tendencies I've observed from various smaller-medium sized projects.
In regards to Rust, the slowness is not even so much the compiler itself as it is cargo. I literally just tested it before writing this paragraph. The time it took to compile the basic hello world program was 0.159 seconds with rustc, and 0.718 seconds on the first run of "cargo build". However, running cargo build for a SECOND time produced a compile time of 0.043 seconds, because the caches were loaded up. Contrasting that, rustc on its second run was 0.13 seconds.
So, a lot of it varies, however I can objectively say that on FIRST run of "cargo build", it is significantly slower than pretty much any compiler I have ever tried. That seems to be the price paid for the extra safety (and the convenience of cargo) so it's up to you what you find more important.
Let's be real here though. How unsafe a program is is ultimately up to those who developed it. It is perfectly possible to create "safe" programs in languages like C or C++, even languages like Python. If you cover your bases, you should be fine in just about any language. What makes Rust special when it comes to safety is the fact that it FORCES everything to be "safe", even when it doesn't make much sense.
At the end of the day, they're all good languages. Worrying about what language is the best is frankly just idiotic since they all have their pros and cons. Whatever works for you is amazing.
For those curious, I decided to test C and C++ too.
Hello world in C:
cc – 0.193s
gcc – 0.39s
clang – 1.031s!!!!
I ran clang a second time because wtf. Seems it needed the caches loaded too, because a secon run produced 0.058. So, an instance where clang was slower than gcc.
C++:
g++ – 0.719!!
Ran it again, got 0.261
clang++ – 0.390, much faster than g++ for the first run.
The second run, 0.305, which was slightly slower than the g++ run.
Mind you, that is just hello world, but it is still very indicative of the variance involved in making compile times slow or fast. If it varies that much for such a simple program, that says a lot.
Why is everyone so much talking about compile speed , I can wait 10 days to compile , no issues , but I want my code ultra performance because once it's done that code will stay there until the next version rolled out .. who is making these nonsense videos .. those who say compile slowness I guess doing it on small laptops , sure . Those who don't have a workstation making this judgement
Impressive. Very nice. Let's see Rust's segmentation faults.
Butthurt Rusticians in 3, 2, 1… 😂
Rust: debugging today for next year race lol
rust compiler is an airplane checklist
Meanwhile Java & Python ?
but rust wins in load performance using web server
V language should be the fastest