Slashdot Mirror


Blinking Cursor Devours CPU Cycles in Visual Studio Code Editor (theregister.co.uk)

An anonymous reader shares a report on The Register: Microsoft describes Visual Studio Code as a source code editor that's "optimized for building and debugging modern web and cloud applications." In fact, VSC turns out to be rather inefficient when it comes to CPU resources. Developer Jo Liss has found that the software, when in focus and idle, uses 13 percent of CPU capacity just to render its blinking cursor. Liss explains that the issue can be reproduced by closing all VSC windows, opening a new window, opening a new tab with an empty untitled file, then checking CPU activity. For other macOS applications that present a blinking cursor, like Chrome or TextEdit, Liss said, the CPU usage isn't nearly as excessive. The issue is a consequence of rendering the cursor every 16.67ms (60 fps) rather than every 500ms.

12 of 236 comments (clear)

  1. Holy Blinking Cursor, Batman! by BeerCat · · Score: 5, Funny

    13 per cent CPU. For a blinking cursor. That's... impressive.

    But not in a good way

    --
    "She's furniture with a pulse"
    1. Re:Holy Blinking Cursor, Batman! by number6x · · Score: 5, Interesting

      Reminds me of the map of system calls in Apache vs MS IIS. An exercise in design analysis.

    2. Re: Holy Blinking Cursor, Batman! by Anonymous Coward · · Score: 5, Insightful

      There's a difference between remembering the piece of trivia that is the name a certain environment calls a concept and understanding the concept.

      The question becomes: are you looking for a software engineer, a computer programmer, or a trivia expert?

  2. Maybe they shouldn't use Javascript ... by drnb · · Score: 5, Funny

    13% of CPU at 60 fps. Maybe they shouldn't use Javascript and a cross platform framework for drawing the cursor. ;-)

  3. Probably a minor oversight. Will likely be fixed. by Anonymous Coward · · Score: 5, Insightful

    Seems like a minor oversight. It will probably be fixed soon, if it hasn't already been.

    Microsoft has actually done a good job with Visual Studio Code. It's a lot better to use than, say, Atom or EMACS. It has some great plugins, they're easy to install, and overall it provides a good compromise between a plain text editor and a full-featured IDE.

    I'm not going to hold this minor bug against them.

  4. Devil in the Details... by EndlessNameless · · Score: 5, Interesting

    Is it rendering the cursor specifically at 60 FPS, or is it the entire active window?

    Because I can imagine a good reason for rendering the active window in an IDE every frame. Your brain is definitely capable of registering visual changes faster than once every 500ms.

    If you have smart syntax highlighting, you want the squiggly lines, tab-complete indicators, color coding, and highlights to appear ASAP. The sooner you notice a mistyped function name, the less characters you have to back over to fix it.

    A fast, responsive window refresh is essential to modern IDEs.

    I mean, feel free to call them out if Eclipse or whatever is much better at it, but I can totally see why they would rerender the entire window. If it is the active window (per the summary), then you can assume it's being used and therefore deserves the most responsive output possible.

    --

    ---
    According to the latest ruleset, this post should be modded as Vorpal Flamebait +5.
  5. 60 FPS is the minimum these days by tobiasly · · Score: 5, Funny

    Well I would hope that a modern IDE released in 2017 would have 60 FPS! I also have the 4K cursor, HDR cursor, 3D cursor, Retina cursor, and VR cursor plugins all enabled, but I realize that may be overkill for some people. As soon as I get my new water cooling rig set up it'll be buttery smooooth.

  6. Re:Probably a minor oversight. Will likely be fixe by Tailhook · · Score: 5, Interesting

    Microsoft has actually done a good job with Visual Studio Code.

    If you're willing to completely dismiss performance concerns then yes, great work. On the other hand, if you care about performance, and memory usage, it's pretty hard to do worse than VSCode without including including something like Eclipse or Intellij in the survey.

    --
    Maw! Fire up the karma burner!
  7. Re:Probably a minor oversight. Will likely be fixe by Grishnakh · · Score: 5, Insightful

    No, it sounds like the problem is the insane idea of running local code through a web browser. The web itself is probably the most Rube Goldberg-esque way of displaying interactive data and controls to a user (HTML, a backend language like PHP/Java, a client-based language (JavaScript), and then a crappy markup language for style attributes (CSS)). It's understandable how it evolved, but it makes no sense at all to use this for local applications.

  8. don't use the 'web stack' for desktop applications by epyT-R · · Score: 5, Informative

    It duplicates functionality and kills performance

  9. Re:Probably a minor oversight. Will likely be fixe by DickBreath · · Score: 5, Funny

    Please do not knock Emacs.

    Emacs is very popular. Popularity seems to correlate highly with the set of users who once started up Emacs, were unable to figure out how to exit from Emacs, then had no choice but to write Emacs Lisp extensions to accomplish all other necessary tasks.

    I don't think VS Code can make that claim.

    --

    I'll see your senator, and I'll raise you two judges.
  10. Gloves off! by Kludge · · Score: 5, Interesting

    OK, buddy, vi vs. emacs flame wars were funny, and perhaps justifiable.
    But comparing VS to emacs?? No freaking way! Emacs totally kicks VS ass.
    And it never used 13% of my cpu to flash a cursor.