all 49 comments

sorted by: hot top controversial new old
[–] 56 points 2 years ago (4 children)

"I'm writing a recursive method with threads to optimize the CPU usage in a 0.02%" THIS IS A NONSENSICAL STATEMENT MADE BY DERANGED PEOPLE

I mean this is correct though

  • source
  • hideshow 4 child comments
  • [–] 15 points 2 years ago (2 children)

    Recursion makes it cheaper to run in the dev's mind, but more expensive to run on the computer. Subroutines are always slower than a simple jump.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 7 points 2 years ago

    Recursion makes it cheaper to run in the dev's mind, but more expensive to run on the computer.

    Maybe for a Haskell programmer, divide-and-conquer algorithms, or walking trees. But for everything else, I'm skeptical of it being easier to understand than a stack data structure and a loop.

  • source
  • parent
  • [–] 55 points 2 years ago (2 children)

    moneymoneymoneymoneymoneymoneymoney moneymoneymoneymoneymoneymoneymoney moneymoneymoneymoneymoneymoneymoney moneymoneymoneymoneymoneymoneymoney

  • source
  • hideshow 2 child comments
  • [–] 38 points 2 years ago (1 child)

    while (true) { print money; }

    Someone’s never heard of Bitcoin

  • source
  • hideshow 1 child comment
  • [–] 18 points 2 years ago (1 child)

    Did the person writing this have a stroke?

  • source
  • hideshow 1 child comment
  • [–] 18 points 2 years ago (5 children)

    Optimizing CPU usage by 0.02% is something only the truly deranged do

  • source
  • hideshow 5 child comments
  • [–] 13 points 2 years ago

    I saw an article last week about a one-liner they were adding to the Linux kernel that would reduce the startup time by .03 seconds, and let me tell you, I was relieved.

  • source
  • parent
  • [–] 11 points 2 years ago (2 children)

    Not necessarily. It depends on what you're optimizing, the impact of the optimizations, the code complexity tradeoffs, and what your goal is.

    Optimizing many tiny pieces of a compiler by 0.02% each? It adds up.

    Optimizing a function called in an O(n^2^) algorithm by 0.02%? That will be a lot more beneficial than optimizing a function called only once.

    Optimizing some high-level function by dropping into hand-written assembly? No. Just no.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 2 years ago (1 child)

    0.02% means you’re saving a fraction of a second for every hour of runtime. A lot of adding up is required to make it significant enough for anyone to notice.

    Better to spend that time and effort on things that actually bring value. These kind of micro optimizations can also make the code unnecessarily complicated and difficult to work with, which is a hindrance for the optimizations that truly matter.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 2 years ago*

    In a single one-off program or something that's already fast enough to not take more than a few seconds—yeah, the time is spent better elsewhere.

    I did mention for a compiler, specifically, though. They're CPU bottlenecked with a huge number of people or CI build agents waiting for it to run, which makes it a good candidate for squeezing extra performance out in places where it doesn't impact maintainability. 0.02% here, 0.15% there, etc etc, and even a 1% total improvement is still a couple extra seconds of not sitting around and waiting per Jenkins build.

    Also keep in mind that adding features or making large changes to a compiler is likely bottlenecked by bureaucracy and committee, so there's not much else to do.

  • source
  • parent
  • [–] 15 points 2 years ago (4 children)

    I'm a senior dev and I'll be honest: I'm not sure what I do.

  • source
  • hideshow 4 child comments
  • [–] 27 points 2 years ago (3 children)

    You enchant rocks engraved with runes

  • source
  • parent
  • hideshow 3 child comments
  • [–] 7 points 2 years ago (2 children)

    Computer programmers are the wizards of the present.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 8 points 2 years ago* (last edited 2 years ago) (1 child)

    There was a series of books in the '80s where a systems programmer gets pulled through a portal into your typical magical world, good vs evil, etc.

    They subsequently look at the magical spells in use and realise they can apply Good Systems Programming Practices™ to them. And thus, with their knowledge of subroutines and parallel processing, they amplify their tiny innate magical abilities up to become a Pretty Good Magician™. So while all the rest of the magicians basically have to construct their spells to execute in a linear fashion, they're making magical subroutines and utility functions and spawning recursive spells without halting checks and generally causing havoc.

    It's quite a good allegory for modern times, where a select few build all the magic and the rest just have useful artefacts they use on a day to day basis with no idea how they work

  • source
  • parent
  • hideshow 1 child comment
  • [–] 9 points 2 years ago (1 child)

    I take offense to the teapot joke. Leave the teapots out of it.

  • source
  • hideshow 1 child comment
  • [–] 7 points 2 years ago

    The angle between my chin and my lip corner has increased. Thank you.

  • source
  • [–] 7 points 2 years ago

    Jokes on you, the Fed has been running that bottom program for years.

  • source
  • [–] 6 points 2 years ago (1 child)

    What scares me, is that this can really not be a joke

  • source
  • hideshow 1 child comment
  • [+] 6 points 2 years ago* (last edited 7 months ago) (5 children)
  • [–] 41 points 2 years ago (4 children)

    I mean, that's what a meme template is, yes.

  • source
  • parent
  • hideshow 4 child comments
  • [+] -15 points 2 years ago* (last edited 7 months ago) (2 children)
  • [–] 14 points 2 years ago* (last edited 2 years ago)

    There's literally a community somewhere here centered around versions of this template. I've personally seen version posted a few other places on Lemmy, too.

    I'll let others be the judge of if you can steal a joke on the internet, or if they're some kind of collective property. Maybe it's worse now but TBH I didn't get it the first time.

  • source
  • parent
  • [–] 6 points 2 years ago

    I think I had enough Internet for today.

  • source
  • [–] 5 points 2 years ago (2 children)

    OK. I guess it's time to go start my rutabaga farm now.

  • source
  • hideshow 2 child comments
  • [–] 4 points 2 years ago (5 children)

    What's the teapot a reference to?

  • source
  • hideshow 5 child comments
  • [–] 3 points 2 years ago

    I can't not read this in Ron Swanson's voice.

  • source
  • [–] 3 points 2 years ago

    But we had to program the computer for it to be able to do math in the first place?

  • source
  • Why is it that 5 minutes before bed time when I'm really tired do I have the urge to fire up a C tutorial?

  • source
  • [–] 2 points 2 years ago

    All this computer stuff is a complete useless scam for sure.

  • source