Originally posted by Raka555
View Post
Rust-Based, Memory-Safe PNG Decoders "Vastly Outperform" C-Based PNG Libraries
Collapse
X
-
Originally posted by amxfonseca View PostObserved result (aka reality):
- Compiler produces faster code than superior elite developers.
No one is surprised, modern compilers are that good! Combine that with a clean and modern language (doesn't even need to be Rust) and you have a killer combo.
Oh, if only Rust didn't hurt my eyes every time I look at it, I would very much consider to pick up that language just to get to know the borrow checker and other semantic aspects of Rust.
Imagine Rust with a fully typed, statically checkable, super-optimizable, compilable Python syntax! Oh, the wonders the world would see! :-)
Comment
-
-
Originally posted by sophisticles View PostWhat I would like to know is how much of this speed improvement is due to the programming language used and how much is due to the programming techniques being use.
Originally posted by sophisticles View PostHere's my thinking, it could be that people that are using Rust are more aware of memory safe programming techniques than the programmers using C and so they employ more efficient algorithms, which in turn leads to better performance.
Actually this is not my thinking, it is just the reality. You could reach the same conclusion if you bother to read the code of both implementations.
And that is the real answer. Rust is more productive than C the same way C is more productive than assembly. It allows the developer to focus on his/her code, instead of memory management or complex error handling patterns. Why do something manually when a compiler can do it better?
Give a Rust, C and Assembly developer the same amount of time to build the same piece of software, and the Rust developer will come up with better results than the C developer, the same way that the C developer will come up with better results compared to the Assembly developer.
Comment
-
-
Originally posted by archfrog View PostOh, if only Rust didn't hurt my eyes every time I look at it, I would very much consider to pick up that language just to get to know the borrow checker and other semantic aspects of Rust.
I wish this whole Rust vs C discussion would sum to this. Instead of coming up with some random fabricated statements that can be proved wrong in less than 5 seconds.
Comment
-
-
Originally posted by sobrus View PostUsually pure C has very slight speed advantage anyway.
Comment
-
-
Sorry, but this is peace of cake. Did you ever see C++ template meta-programming? I develop in C++ for a living and templates still causes me some headache. Also the undefined behaviour.Last edited by Steffo; 09 December 2024, 03:57 PM.
Comment
-
-
Originally posted by brad0 View Post
Most Rust threads are full of deranged loony toons Rust proponents. It's no wonder the have such a bad reputation.
Comment
-
-
Originally posted by amxfonseca View PostBy writing an equally performant version in C. It is possible, but why would anyone bother with it?
Here is my thinking, it could be that people writing the code are aware of compiler optimisations and wrote it in a way that the compiler would auto vectorise it. This approach not only it produces faster code than the currently optimised libpng (although the SSE code was hand written in that case), it will also have higher chances of further performance gains due to future compiler improvements.
Actually this is not my thinking, it is just the reality. You could reach the same conclusion if you bother to read the code of both implementations.
And that is the real answer. Rust is more productive than C the same way C is more productive than assembly. It allows the developer to focus on his/her code, instead of memory management or complex error handling patterns. Why do something manually when a compiler can do it better?
Give a Rust, C and Assembly developer the same amount of time to build the same piece of software, and the Rust developer will come up with better results than the C developer, the same way that the C developer will come up with better results compared to the Assembly developer.
There was a time programmers made extensive use of assembler and didn't rely on a compiler to auto vectorize a thing, they hand optimized their code.
Today you have people with the equivalent skill level of a high school kid writing code using generic algorithms hoping that some programmer more talented than them writes a compiler that will make them look like they know what they are doing.
Comment
-
Comment