Skip to content
DevMeme
6880 of 7435
VSCode Terminal Paste Is Slow Because It Literally Sleeps Every 50 Characters
IDEs Editors Post #7542, on Dec 13, 2025 in TG

VSCode Terminal Paste Is Slow Because It Literally Sleeps Every 50 Characters

Description

A screenshot of a tweet by Jarred Sumner (@jarredsumner, creator of Bun runtime) on X.com. The tweet reads: 'Why is pasting into VSCode Terminal slow? Because it sleeps for 5ms every 50 characters.' Below the text is a code diff screenshot showing the actual VSCode source code. Lines 21-24 contain comments explaining: 'Writing large amounts of data can be corrupted for some reason, after looking into this is // appears to be a race condition around writing to the FD which may be based on how powerful the // hardware is. The workaround for this is to space out when large amounts of data is being written // to the terminal.' followed by constants 'WRITE_MAX_CHUNK_SIZE = 50' and 'WRITE_INTERVAL_MS = 5'. Lines 263-269 show the setTimeout implementation using these constants. A reference to github.com/microsoft/vscode/issues/38137 is included

Comments

25
Anonymous ★ Top Pick The real race condition was between Microsoft fixing the bug properly and the heat death of the universe, and the universe is winning
  1. Anonymous ★ Top Pick

    The real race condition was between Microsoft fixing the bug properly and the heat death of the universe, and the universe is winning

  2. @tuguzT 7mo

    There is nothing more stable than temporary

    1. @efim002 7mo

      And here no one even said it was temporary

  3. @b7sum 7mo

    i've read the comments now

  4. @WaterCat73 7mo

    Link from meme: https://github.com/microsoft/vscode/issues/38137

    1. @nwordtech 7mo

      > closed as wontfix

  5. @ruslanblack 7mo

    and it wasn't even written by a ai, surely

    1. @lord_nani 7mo

      It wasnt

    2. @chupasaurus 7mo

      MS is notorious on not getting how to display texts in terminal

      1. @TheFloofyFloof 7mo

        can't be worse than jetbrains

        1. @chupasaurus 7mo

          much worse actually

  6. @Agent1378 7mo

    this is shitiest coding possible. Vscode can not be trusted. 🤡🤡🤡🤡🤡🤡🤡

    1. @ajnart 6mo

      Proving my point above because this is an unemployed comment and then he says he can’t make a PR for it, making him beyond unemployed

  7. @nwordtech 7mo

    Old faithful "just put sleep in here and there would be no data race issues"

  8. @nwordtech 7mo

    Double buffering and a mutex for swapping would fix this but js devs are not that smart

    1. @mrYakov 7mo

      I dont know about internals of this, but still, how data race even possible if you just insert into stream. something go wrong on conceptual level here

    2. Егор 7mo

      Make a PR

      1. @nwordtech 7mo

        965 pull requests are open on there oldest dated 2016. Do I really?

        1. @DerKnerd 7mo

          do 966 PRs

        2. Егор 7mo

          And? 46294 are closed. Are you just trying to find an excuse.

      2. @nwordtech 7mo

        Anyways good idea but I shall continue excusing my lazyness

  9. @FunnyGuyU 6mo

    Must be a reason. Instead of optimizing something slow someone was lazy and just made a delay. I wonder what would break if this code is removed.

  10. dev_meme 6mo

    I love Internet

  11. @ajnart 6mo

    People thinking this is not acceptable and clowning it are beyond unemployed behavior

    1. @Agent1378 6mo

      Solving race condition with delay, not because it is really needed but because it's just a lucky guess - that's as close to the clowning as it gets in programming. "Software shit " as Ivan puts it.

Use J and K for navigation