Zed is a modern open-source code editor, built from the ground up in Rust with a GPU-accelerated renderer.

  • eveninghere@beehaw.org
    link
    fedilink
    arrow-up
    1
    ·
    5 months ago

    At this point I’m not expert enough to explain more details. You can check font renderers.

    Below is what’s in my mind but it’s just a guess.

    In typical PC architectures you have IO between the storage and the RAM, and then there’s the copying from the RAM to the VRAM, and editors maybe also want copying from the VRAM to RAM for decoration purposes etc.

    • Mia
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      5 months ago

      I am familiar with the current PC and GPU architectures.

      IO is a non issue. Even a massive file can be trivially memory mapped and parsed without much hassle, and in the case of a text editor you’d have to deal with IO only when opening or saving said file, not during rendering.

      As for the rendering side, again, the amount of memory you’d have to transfer between RAM and VRAM would be minimal. The issue is latency, not speed, but that can be mitigated though asynchonous transfer operations, so if done properly stutters are unlikely.

      Rendering monospaced fonts (with decorators and control characters) at thousands of frames a second nowadays is computationally trivial, take a look at refterm for an example. I suspect non-monospaced fonts would require more effort, but it’s doable.

      As I said at the beginning, it’s not impossible, just a pain. But so is font rendering in general honestly :/