Rust-Based, Memory-Safe PNG Decoders "Vastly Outperform" C-Based PNG Libraries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • sobrus
    Senior Member
    • Apr 2021
    • 191

    #21
    C and Rust are more or less equally performant and both gcc and rustc (llvm? As far as I know rustc uses llvm as a compiler backend) feature autovectorization (can automatically use avx).
    It's (most probably) just that the newer decoder implementation is simply better.
    The advantages of rust are more than just pure speed. Usually pure C has very slight speed advantage anyway.
    Last edited by sobrus; 09 December 2024, 11:41 AM.

    Comment

    • sophisticles
      Senior Member
      • Dec 2015
      • 2591

      #22
      What 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.

      Here'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.

      Comment

      • chuckula
        Senior Member
        • Dec 2011
        • 844

        #23
        Originally posted by amxfonseca

        Why are you so dumb? Were you born like that, or did you have to go to a special dumbo training academy?


        Not that you could understand the code anyway, it is out of your reach.



        Nope, you didn't read it because you simply aren't able to.
        Uh... You literally cited some ancient SSE intrinsic code to call *me* "dumb" for correctly pointing out that the C library wasn't optimized for a completely different SIMD implementation on a completely different architecture??

        This is exactly what I mean, you RUST religious nuts don't even understand basic differences in hardware architectures while jumping up and down about how great your bloat is.

        Comment

        • bug77
          Senior Member
          • Dec 2009
          • 6516

          #24
          Originally posted by sophisticles View Post
          What 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.

          Here'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.
          Rust compiles via LLVM, so the language on its own cannot be faster than C.
          Therefore you were right, the advantage comes from a combination of the compiler slapping your hand when you do stupid things and you daring to try bolder things knowing the compiler will slap you on your hand if needed.

          Comment

          • Espionage724
            Senior Member
            • Sep 2024
            • 356

            #25
            Meh, if something is faster in Rust, it just means the C/C++ version can be optimized further

            I like the idea of someone intentionally coding for memory safety, vs being limited from not doing so by code.
            Last edited by Espionage724; 09 December 2024, 12:23 PM.

            Comment

            • Errinwright
              Senior Member
              • Aug 2023
              • 188

              #26
              People talk about pro Rust people coming out of the shadows to promote their language, but the entirety of the first comments page was immediately filled with the usual toxic anti-Rust people who managed to a) miss the technical points, b) spread misinformation and c) spew their repackaged [now-standardized] anti-Rust comments. Can't make this shit up if you tried

              Comment

              • Raka555
                Junior Member
                • Nov 2018
                • 681

                #27
                Lets talk again in a few years when someone has to maintain this ...

                image.png

                Comment

                • geerge
                  Senior Member
                  • Aug 2023
                  • 359

                  #28
                  I am skeptical because libpng and stb_image are not made to be fast, one is made to be feature complete and the other is made to have maintainable code. We need a lovingly optimised to hell and back implementation of a decoder in C to compare to.

                  Comment

                  • dlq84
                    Senior Member
                    • Jul 2012
                    • 432

                    #29
                    Originally posted by skeevy420 View Post
                    That headline is kind of misleading. Only 2 of 3 are written with Rust.

                    It brought out the Rust people faster than the speed of light so I suppose it's doing its job
                    Where do you see them? All I see are people with rust derangement syndrome hating on the language. At least the posts before you.

                    Comment

                    • Raka555
                      Junior Member
                      • Nov 2018
                      • 681

                      #30
                      Originally posted by Errinwright View Post
                      People talk about pro Rust people coming out of the shadows to promote their language, but the entirety of the first comments page was immediately filled with the usual toxic anti-Rust people who managed to a) miss the technical points, b) spread misinformation and c) spew their repackaged [now-standardized] anti-Rust comments. Can't make this shit up if you tried
                      I am not anti-Rust. I am anti their unreadable syntax. I can just show you more code and let Rust speak for itself ...

                      Comment

                      Working...
                      X