• rhabarba@feddit.org
    link
    fedilink
    arrow-up
    33
    ·
    2 days ago

    The main problem with modern hardware is that it needs to have an abundance of resources because of sarcastic questions like this. There is no reason why memory-efficient programming should be considered outdated.

    • boonhet@sopuli.xyz
      link
      fedilink
      arrow-up
      12
      arrow-down
      1
      ·
      2 days ago

      Yeah but pretty textures and detailed models are nice too. And maybe you want to use a scripting language for parts of the game to save a bunch kf dev time

      That’s not the same as an unoptimized game. I have games running at triple digit fps that require more memory and disk space than 10 year old me thought possible.

      Also unused memory is useless. Caching things is good.

      • stingpie@lemmy.world
        link
        fedilink
        arrow-up
        8
        arrow-down
        1
        ·
        2 days ago

        Unused memory is not useless, it is just unused. If I want to pull up a guide on how to giggle the grables in my favorite game Grable Giggler, I would be very happy if I had unused memory which I can now use for my browser.

        Also, smaller RAM usage generally correlates to smaller file size, which is very useful on computers with limited storage.

        And finally, there’s also low spec gaming and accessibility. Minecraft, at least prior to the microsoft acquisition, was a very low spec game. I wouldn’t say it was optimized, but a game of minecraft took less ram than chrome. There was nearly no computers at the time which couldn’t run minecraft. At the time of minecraft’s early boom, kids were getting low-spec hand-me-downs, and so minecraft was one of the most open-ended games they could play. What I’m trying to say is that minecraft—and Doom for that matter—owe a large part of their success to low memory usage.

        • boonhet@sopuli.xyz
          link
          fedilink
          arrow-up
          5
          arrow-down
          2
          ·
          edit-2
          2 days ago

          Unused memory is not useless, it is just unused

          Yes, which means it’s doing precisely nothing to improve your performance.

          If I want to pull up a guide on how to giggle the grables in my favorite game Grable Giggler, I would be very happy if I had unused memory which I can now use for my browser.

          Your operating system should just free up some memory for that. In fact, your browser could be in memory before you decide to launch it. That’s the magic of caching, baby! I’m just saying, don’t be afraid to use memory - people are already buying way more of it than they need. That doesn’t mean you should be creating games with memory leaks! But e.g loading things into memory before they’re used saves you loading from disk in the moment - which would be slow.

          And finally, there’s also low spec gaming and accessibility. Minecraft, at least prior to the microsoft acquisition, was a very low spec game. I wouldn’t say it was optimized, but a game of minecraft took less ram than chrome.

          Minecraft was made in Java, the JVM is literally one of the worst platforms for memory usage (running something in the browser is just about the only way to make it use more memory than Java), so that just proves my point: Optimizing down to the kilobyte is useless in 2025. It was already useless in 2010. Also, you’ll be happy to know that Microsoft rewrote it in C++ to save memory, it’s called the Bedrock Edition and it runs on cheaper hardware than the Java Edition!

          In fact, the horribly memory inefficient platform, Java, greatly contributed to its success! First off, it was much faster for Notch alone (initially) to write it in Java compared to C. Secondly, it allowed for much easier modding.

          and Doom

          came out in 1993, when 16 gigabytes of memory would’ve cost 2,867,200 USD (175 dollars for 1MB is what I found online). Now it’s 50 bucks. 40 if you have an older machine that runs DDR4 and 30 if you have a DDR4 laptop.

          • rhabarba@feddit.org
            link
            fedilink
            arrow-up
            3
            ·
            2 days ago

            Caching is a weird term for “just move the needless waste of space into another part of the computer”.

            • boonhet@sopuli.xyz
              link
              fedilink
              arrow-up
              2
              ·
              2 days ago

              I mean you can also just install a bare OS with no additional software, even a browser, and get by with 128 MB of RAM even in 2025. Then you’re not wasting any space. It should also fit onto a 1 GB microSD card so no need to have any real storage.

      • ulterno@programming.dev
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        5
        ·
        2 days ago

        Also unused memory is useless

        Unused memory means:

        • I can let updates continue in the background
        • I can open a web-browser on a second monitor
        • I can afford to buy less memory
        • I can run a server on the same computer, instead of having to buy another one to become a dedicated server
        • boonhet@sopuli.xyz
          link
          fedilink
          arrow-up
          5
          arrow-down
          1
          ·
          2 days ago

          I can let updates continue in the background

          That’s used memory

          I can open a web-browser on a second monitor

          That’s used memory

          I can afford to buy less memory

          But I bet you don’t, because you look at your computer say it’s all being used - when actually a lot is being used for caching and is freed upon request.

          I can run a server on the same computer, instead of having to buy another one to become a dedicated server

          That’s, again, used memory

          • ulterno@programming.dev
            link
            fedilink
            English
            arrow-up
            4
            arrow-down
            4
            ·
            edit-2
            2 days ago

            That’s used memory

            That’s memory not hogged by a single program, making me able to use it for other stuff.

            because you look at your computer say it’s all being used

            You’re lucky you didn’t bet any material thingy on it. I wait for the OOM killer to fire up before saying, “it’s full”.
            While I do have enough memory on my desktop, I only have 8GB on my laptop (the other 8GB one I bought, went bad early, or maybe it’s just the slot that has stopped working, it could be anything), making it hard to even use the clang tools on large projects.


            So there is this game called “Endless Sky” and its high-dpi stuff is in another separate package.
            If I install the high-dpi package on the laptop, it crashes before even completely starting, while it works perfectly well, on removing the high-dpi package.

            • boonhet@sopuli.xyz
              link
              fedilink
              arrow-up
              4
              arrow-down
              1
              ·
              2 days ago

              That’s memory not hogged by a single program, making me able to use it for other stuff.

              But it’s not unused memory.

              People have this weird fetish with free memory. Remember all the idle app killers on Android, etc?

              Besides, if I’m playing a game, I WANT it to have preloaded assets so I don’t have to wait for them to load from the NVMe. I also don’t want the developer to spent half their time reducing memory usage by 10 kilobytes - I’d much rather that time is spent on making the game do more things.

              I wait for the OOM killer to fire up before saying, “it’s full”.

              Then you’re already different from most the “everything uses too much memory these days” folks. Most look at the Windows task manager which shows 14 gigs in use out of 16 and go buy more - because Windows dared use 8 gigabytes of cache that it was completely willing to free if another program asked for it.

              In fact, I should be panicking right now:

                             total        used        free      shared  buff/cache   available
              Mem:        32789900    21931604      283888     2760372    13429988    10858296
              Swap:              0           0           0
              
              

              Nearly no free memory!

              making it hard to even use the clang tools on large projects.

              I hope you’re not claiming that to also be wasted memory. clang/LLVM is a pretty complex toolset and does damn near close to magic to optimize the binary it shits out.

              • ulterno@programming.dev
                link
                fedilink
                English
                arrow-up
                2
                ·
                2 days ago

                I hope you’re not claiming that to also be wasted memory

                Yeah, I’m not.
                And I’m not talking about the optimising compiler part, but about the continuous code analysers that give warnings and completions to the IDE on the fly.
                That was just an example to show how low 8GB is nowadays.

                But it’s not unused memory.

                Its unused until I decide to run said second program to use it.
                ⇒ Unused memory is not useless, but usable.

                What you were saying earlier would have been the equivalent of, “the other clothes kept in my wardrobe are useless”, when you clearly have the option to use the clothes in that wardrobe.

                • boonhet@sopuli.xyz
                  link
                  fedilink
                  arrow-up
                  3
                  arrow-down
                  1
                  ·
                  2 days ago

                  But the thing is, you can’t use all your clothes at once, your memory CAN all be useful in the moment, hence no need to be anal about leaving it unused.

                  In your example, those tools are providing you with insight and you could turn them off. They have to index a bunch of files and build models of them in memory.

                  Then when you actually run your compiler, it’s helpful that your OS has probably “wasted” some RAM keeping source files cached after a few runs, even the ones you haven’t edited recently.

                  • ulterno@programming.dev
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    arrow-down
                    3
                    ·
                    2 days ago

                    you can’t use all your clothes at once

                    I just have to explain each and every facet of this silly little analogy to you because you really just only want to stick to your line of , “unused memory is useless”.
                    Alright, I will.

                    You can use the other clothes to:

                    • wear multiple layers
                    • lend them to your friends or whomever wants them

                    It can be a shared wardrobe, like in events and such:

                    • then, having remaining clothes means, others can come and take them

                    Unused memory is not useless.
                    It gives an option to others whether or not to use it.

                    And caching stuff really has nothing to do with having used Python vs C++ or Rust or whatever.
                    That is a totally different option.

                    If your program is taking up more working memory, you then have less memory for the caching, that you are calling “good”.


                    In your example, those tools are providing you with insight and you could turn them off. They have to index a bunch of files and build models of them in memory.

                    Then when you actually run your compiler, it’s helpful that your OS has probably “wasted” some RAM keeping source files cached after a few runs, even the ones you haven’t edited recently.

                    I am not going to even try to explain it to you how far that is from what I mean by the words the you can go up and read.


                    And when creating a framework for scripting, you need to be careful about the features, least you end up forcing single threading everything. (See X4)