Silver's Home
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@chrs@programming.dev to Rust@programming.devEnglish • 1 year ago

"Clean" Code, Horrible Performance in Rust

chrs.dev

external-link
message-square
31
fedilink
60
external-link

"Clean" Code, Horrible Performance in Rust

chrs.dev

@chrs@programming.dev to Rust@programming.devEnglish • 1 year ago
message-square
31
fedilink
I was just recently going through some old episodes from Software Engineering Radio when I came across this one episode featuring Casey Muratori, where he goes through some of his thoughts around his video from February 2023, titled "‘Clean’ Code, Horrible Performance". I was actually already aware of the video by this time, but listening through the episode gave me an itch to see these concepts in my reality, experiment them by myself.
  • @arendjr@programming.dev
    link
    fedilink
    9•1 year ago

    I think they meant using for accumulating, like this:

    shapes.iter().map(Shape::area).sum()
    
    • Turun
      link
      fedilink
      4•1 year ago

      Yes. That’s what I meant.

      Though I heavily expect the rust compiler to produce identical assembly for both types of iteration.

    • @onlinepersona@programming.dev
      link
      fedilink
      English
      2•1 year ago

      Oh, I see. That would be interesting to benchmark too 👍

      Anti Commercial AI thingy

      CC BY-NC-SA 4.0

      • @sugar_in_your_tea@sh.itjust.works
        link
        fedilink
        2•1 year ago

        Anti Commercial AI thingy

        Off-topic, but does that actually work? I would assume OpenAI would just ignore it and you’d have to prove that they did so.

        • @onlinepersona@programming.dev
          link
          fedilink
          English
          5•1 year ago

          Dunno if it works. AI has been tricked into revealing it’s training data, so it’s possible that it happens and they are sued for using copyrighted material.

          This is my drop in the ocean.

          Anti Commercial AI thingy

          CC BY-NC-SA 4.0

          • @sugar_in_your_tea@sh.itjust.works
            link
            fedilink
            2•1 year ago

            Maybe I’ll join you. :)

            • @onlinepersona@programming.dev
              link
              fedilink
              English
              3•1 year ago

              Welcome 🙂 A drop more.

              Btw, if you’re using linux and X11, you can bind a keyboard shortcut to the following shell-script (probably will need to install xte).

              #!/usr/bin/env bash
              sleep 0.5
              xte "str ::: spoiler Anti Commercial AI thingy"
              xte "key Return"
              xte "str [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)"
              xte "key Return"
              xte "str :::"
              
              Anti Commercial AI thingy

              CC BY-NC-SA 4.0

              • @sugar_in_your_tea@sh.itjust.works
                link
                fedilink
                3•1 year ago

                I’m on Wayland, but I’m sure I can figure something out.

                I do most of my lemmy-ing on mobile, so I’ll probably make a bot to auto-edit my posts or something.

                • @onlinepersona@programming.dev
                  link
                  fedilink
                  English
                  3•1 year ago

                  Have fun! I’m curious how you’ll do it. If you figure out a way on Wayland, it would be great to read about it!

                  Anti Commercial AI thingy

                  CC BY-NC-SA 4.0

Rust@programming.dev

!rust@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !rust@programming.dev

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits
  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
  • 48 users / day
  • 183 users / week
  • 395 users / month
  • 2.86K users / 6 months
  • 6.92K subscribers
  • 945 Posts
  • 4.38K Comments
  • Modlog
  • mods:
  • snowe
  • Ategon
  • EdTheLegendary
  • @kahnclusions@programming.dev
  • @torcherist@programming.dev
  • BE: 0.19.3
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org