• baines@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 months ago

      maintainable code is most efficient

      sure there is a trade off but i’d rather runtime be slower than fancy brittle faster code

      • vrek@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        6 months ago

        Within reason this is true but you also have to agree that it often goes too far. Not everything needs to be an interface or factory. For example if your making a pdf viewer dont concern yourself with abstracting how to open a file, you know it will be a pdf. If someone opens a gif with a pdf reader it’s ok to give an error. Plus to me a lot of “maintainable” code is difficult to work with because there’s so many levels of abstraction and functions spread across multiple files I can’t keep all that in my head.

        Also if you only need one or two functions you don’t need to import a whole library. For example look up “handmade hero” and see how Casey works with the windows libraries.

  • Korhaka@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    10
    ·
    6 months ago

    I spent hours improving a website to the point first page load was under 100kB from previously multiple MB. Don’t think anyone will care about or appreciate my work.

    I hope somewhere there was someone on a low end device and they experienced a short load time. But it is near certain that I spent more time optimising it than will ever be saved on loading times for a small business site.

    • luciole (he/him)@beehaw.org
      link
      fedilink
      arrow-up
      4
      ·
      6 months ago

      100 kb from multiple mb is fucking huge and it absolutely makes a tangible difference to anyone firing up the website from mobile data. Do not underestimate the power of snappiness, and keep up the good work.

  • mkwt@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    6 months ago

    And I’m still getting at least 20x speedup on my applications. I don’t know where this 0.001 stuff is coming from.

    • NotSteve_@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      6 months ago

      I think it really depends on the work the program does and how effectively it uses caching, concurrency, etc. Something like data serialisation would probably be a lot slower in Python compared to something like handling simple UI event triggers which might only have that 0.001 difference