• @seaQueue@lemmy.worldOP
      link
      fedilink
      1611 months ago

      The best I can do is an ML model running on an NPU that parses JSON in subtly wrong and impossible to debug ways

      • @Aceticon@lemmy.world
        link
        fedilink
        511 months ago

        Just make it a LJM (Large JSON Model) capable of predicting the next JSON token from the previous JSON tokens and you would have massive savings in file storagre and network traffic from not having to store and transmit full JSON documents all in exchange for an “acceptable” error rate.

      • @AeroLemming@lemm.ee
        link
        fedilink
        English
        511 months ago

        You need to make sure to remove excess whitespace from the JSON to speed up parsing. Have an AI read the JSON as plaintext and convert it to a handwriting-style image, then another one to use OCR to convert it back to text. Trailing whitespace will be removed.

        • @knorke3@lemm.ee
          link
          fedilink
          211 months ago

          Did you know? By indiscriminately removing every 3rd letter, you can ethically decrease input size by up to 33%!

      • Terrasque
        link
        fedilink
        111 months ago

        So you’re saying it’s already feature complete with most json libraries out there?

      • @ramble81@lemm.ee
        link
        fedilink
        111 months ago

        My thoughts on software in general over the past 20 years. So many programs inefficiently written and in 4th level languages just eats up any CPU/memory gain. (Less soap box and more of a curious what if to how fast things would be if we still wrote highly optimized programs)

        • @masterspace@lemmy.ca
          link
          fedilink
          English
          3
          edit-2
          11 months ago

          Answer: there’d be far less software in the world, it would all be more archaic and less useful, and our phones and laptops would just sit at 2% utilization most of the time.

          There’s an opportunity cost to everything, including fussing over whether that value can be stored as an int instead of a double to save 8 bits of space. High level languages let developers express their feature and business logic faster, with fewer bugs, and much lower ongoing maintenance costs.

        • I fully concur. There’s tons of really inefficient software out there that wastes resources just because for a long time, available resources grew fast enough to just keep using more of them without the net speed of an application slowing down. If we didn’t have so many lazy SW devs, I suspect the reduction in needed CPU cycles would have a measurable positive effect on climate change.

        • ChaoticNeutralCzech
          link
          fedilink
          2
          edit-2
          11 months ago

          The website title says “Arm Developer”, not “ARM Developer”, in a clearly non-acronym way so it’s a guide for making prosthetic hardware. Of course you want a cyborg arm to parse JS natively, why else even get one?

        • @barsoap@lemm.ee
          link
          fedilink
          111 months ago

          Nope it’s still a register-register op, that’s very much load-store architecture.

          It’s reduced, not minimalist, otherwise every RISC CPU out there would only have one instruction like decrement and branch if nonzero. RISC-V would not have an extension mechanism. The instruction exists because it makes things faster because you don’t have to do manual bit-fiddling over 10 instructions to achieve a thing already-existing ALU logic can do in a single cycle. A thing that isn’t even javascript-specific (or terribly relevant to json), it’s a specific float to int cast with specific rounding and overflow mode. Would it more palatable to your tastes if the CPU were to do macro-op fusion on 10(!) instructions to get the same result?

      • @vvvvv@lemmy.world
        link
        fedilink
        English
        011 months ago

        106 Gbps

        They get to this result on 0.6 MB of data (paper, page 5)

        They even say:

        Moreover, there is no need to evaluate our design with datasets larger than the ones we have used; we achieve steady state performance with our datasets

        This requires an explanation. I do see the need - if you promise 100Gbps you need to process at least a few Tbs.

        • @neatchee@lemmy.world
          link
          fedilink
          111 months ago

          Imagine you have a car powered by a nuclear reactor with enough fuel to last 100 years and a stable output of energy. Then you put it on a 5 mile road that is comprised of the same 250 small segments in various configurations, but you know for a fact that starts and ends at the same elevation. You also know that this car gains exactly as much performance going downhill as it loses going uphill.

          You set the car driving and determine that, it takes 15 minutes to travel 5 miles. You reconfigure the road, same rules, and do it again. Same result, 15 minutes. You do this again and again and again and always get 15 minutes.

          Do you need to test the car on a 20 mile road of the same configuration to know that it goes 20mph?

          JSON is a text-based, uncompressed format. It has very strict rules and a limited number of data types and structures. Further, it cannot contain computational logic on it’s own. The contents can interpreted after being read to extract logic, but the JSON itself cannot change it’s own computational complexity. As such, it’s simple to express every possible form and complexity a JSON object can take within just 0.6 MB of data. And once they know they can process that file in however-the-fuck-many microseconds, they can extrapolate to Gbps from there

  • Xyloph
    link
    fedilink
    611 months ago

    That is sometime the issue when your code editor is a disguised web browser 😅

  • @Ironfacebuster@lemmy.world
    link
    fedilink
    611 months ago

    Rockstar making GTA online be like: “Computer, here is a 512mb json file please download it from the server and then do nothing with it”

  • @AusatKeyboardPremi@lemmy.world
    link
    fedilink
    011 months ago

    Given it is a CPU is limiting the parsing of the file, I wonder how a GPU-based editor like Zed would handle it.

    Been wanting to test out the editor ever since it was partially open sourced but I am too lazy to get around doing it

    • @icesentry@lemmy.ca
      link
      fedilink
      111 months ago

      That’s not how this works, GPUs are fast because the kind of work they do is embarrassingly parallel and they have hundreds of cores. Loading a json file is not something that can be trivially parallelized. Also, zed use the gpu for rendering, not reading files.

    • @agelord@lemmy.world
      link
      fedilink
      011 months ago

      As far as my understanding goes, Zed uses the GPU only for rendering things on screen. And from what I’ve heard, most editors do that. I don’t understand why Zed uses that as a key marketing point

  • voxel
    link
    fedilink
    0
    edit-2
    11 months ago

    there are simd accelerated json decoders

  • @jballs@sh.itjust.works
    link
    fedilink
    English
    011 months ago

    I have the same problem with XML too. Notepad++ has a plugin that can format a 50MB XML file in a few seconds. But my current client won’t allow plugins installed. So I have to use VS Code, which chokes on anything bigger than what I could do myself manually if I was determined.