I wrote a minimalist fetch tool for Linux with Python programming language. Have a look: mlzfetch. UPDATE: Now with installation support (pip install .) Also I added a performance benchmark into README.

  • org@lemmy.org
    link
    fedilink
    arrow-up
    2
    ·
    17 hours ago

    Bash would be more efficient at this point. But you clearly like this for some reason, which is fine.

    • TehPers@beehaw.org
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      16 hours ago

      Rust would be more efficient. Hand written assembly would be more efficient. Using butterflies to manually flip bits in the memory would be more efficient.

      OP wanted to use Python. It’s not a very large program. It really doesn’t matter.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      17 hours ago

      I don’t believe that. In fact, neofetch is written in Bash and is known to be slow (that is why I looked at faster options). Python is not really slow. It is just a little bit slower on the starting the interpreter, but then it does not matter how fast it is. Because the thing which Python is slow is mostly math and that does not matter much for system query like this.

      Did you test neofetch and this program in Python? Because you would be surprised at how fast it can be.

      • org@lemmy.org
        link
        fedilink
        arrow-up
        1
        ·
        17 hours ago

        Did you test this program re-written as a script vs running it in Python?

        • thingsiplay@lemmy.ml
          link
          fedilink
          arrow-up
          2
          ·
          17 hours ago

          No, but I was not the one claiming that the Bash version would be more performant. As said this is querying the system information, in which Python does basically the same job as Bash. I mean we are not comparing math.

            • thingsiplay@lemmy.ml
              link
              fedilink
              arrow-up
              2
              ·
              17 hours ago

              Dude you started this whole nonsense of Bash being more performant. I say without testing you can’t make such statements. Besides that, neofetch is very slow. And do you have any Python script doing this kind of work that is slower than neofetch or do you repeat what people say without testing? I do lot of Python stuff and you would be surprised how fast it can be.