• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    7
    ·
    4 days ago

    Counterpoint, I wrote a Python program that reads a load of JSON and runs regex searches over it. It was quite slow. Rewrote it in Rust as a straight 1:1 port, no algorithmic changes. 50x speedup.

    I think you must have either done something very wrong or your Python program didn’t really do anything other than call Python built-ins that are actually written in C.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      4 days ago

      It wasn’t a very wrong what I did in Python. I did the obvious thing. While I do not remember details, I remember it had something to do with adding items I think. But sadly I have not documented this issue, that’s on me. It was only noticeable for really huge files like 50MBytes json. Edit: Most weren’t this big, but it also combined over 100 Json files into one, so a search would search them all through and be able to save as a single file.