Live data from Hacker News

VS Code uses 13% CPU when idle due to blinking cursor rendering

github.com

681–690 of 801 posts

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#681
post #608

Earlier quoted context omitted.

> Not to mention network transparency when I need it You realize that no X client draws like this nor has for 20 years right? They all use xshm to upload pixels so this "network transparency" is just buffer copying over the network. Not entirely different from a texture upload to a GPU. > So it's a good job we're about to throw it all out and start again, eh folks? Yes, by those of us who have been working on the sam…

> You realize that no X client draws like this nor has for 20 years right? They all use xshm to upload pixels [...] You seem to be misinformed. Of the applications I mentioned, the main ones (gitk, xterm, emacs, xosview) are not doing that; seen clearly by analysing the X traffic. Of course, some of these could be built with an optional Qt front-end, in which case I would not be surprised. So you stated clearly "all"…

It is reminding me that webkit is grand child of QT. QT > KDE > khtml > webkit

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#682

Earlier quoted context omitted.

To be fair, X11 can't handle multiple displays with mixed DPI.

You sort of can with xrandr scaling.

Last time I did that, my CPU was always spinning and the rendering looked blurry and non-crisp. Now I just prefer to reduce my emacs and terminal font size, and keep Chrome in one display forever.

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#684
post #533

An internet points out that Hackernews' favorite text editor takes up more CPU than the average Hackernews would have had at their disposal 20 years ago just to make the cursor blink on and off. Hackernews circles the wagons to justify the stupid engineering design decisions behind said editor based solely on the fact that embedding a complete Web browser just to draw buttons and text fields "won" over any sensible G…

You know what would be fast for display updating, ncurses. I wonder why they didn't use that? If only we had an ncurses based text editor.

Ncurses is the worst gui toolkit there is (from a developer point of view), although it indeed is lighter on resource usage than most of the others if you do it right.

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#685
post #534

An internet points out that Hackernews' favorite text editor takes up more CPU than the average Hackernews would have had at their disposal 20 years ago just to make the cursor blink on and off. Hackernews circles the wagons to justify the stupid engineering design decisions behind said editor based solely on the fact that embedding a complete Web browser just to draw buttons and text fields "won" over any sensible G…

Best bit is that X11 runs really well these days -- responsive, fast, reliable. Emacs runs great, gitk, xterm, xosview, mplayer window manager, even Firefox is alright. Renoise, Maya, Blender too. Not to mention network transparency when I need it. It's a great environment to get my work done, and 3x hi res displays is the stuff I dreamt of 15 years ago. So it's a good job we're about to throw it all out and start ag…

X11 may "run really well these days" if your reference is X11 twenty years ago, but if you compare X11 to e.g. macOS, it's pretty obvious why Wayland is needed.

X11 network transparency was nice feature when 10 mbit ethernet was hot as pizza, but these days remote desktop protocols offer more practical alternative.

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#686
post #670

Earlier quoted context omitted.

On the other hand, connecting a 4k display in windows will default to configure it at 200% scaling, in mac it defaults to render everything tiny as ants.

> ... in mac it defaults to render everything tiny as ants. I'm a fan of no DPI scaling (100%) at 4K, at least on my 27" monitor. It takes 2-3 months of getting used to, but once your brain and eyes adapt, significantly lower dot pitches become completely unusable. The only thing I change is bumping up my terminal or editor's default font size a tad. That said, I'm not sure how people with 24" 4K monitors do it witho…

I once used 15" MBPr without DPI scaling (2880x1440 native res) for a while. Then I became too worried about my eyes.

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#687

The answer to all this is: "use Qt". "But camgunz, I only know JavaScript" That's cool! Look into QML. "But camgunz, I only know X" That's cool too! Qt4 has a truly ludicrous number of language bindings: https://en.wikipedia.org/wiki/List_of_language_bindings_for_... . Qt5 has a fair number too: https://wiki.qt.io/Language_Bindings . "But camgunz, I need an embedded browser" I agree, separate windows are for savages.…

In what do you prefer to write cross platform apps? Is there a more productive platform?

The thing with the web, is that it's very easy for those familiar with it to try and shove into everywhere, I do it too.

The amount of code that does things that are useful that one can just steal for his project is very high, with all the fiddles and bins and even more importantly, very accessible and, sometimes, when the gui code, it looks really good too, so people use Electron.

BTW, they use Electron because they run the same editor in their Azure platform, as an online editor for files in servers, so knowing this, I'd say picking Electron is a reasonable choice.

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#688

It just doesn't go in my head that we are building text editors inside a web browser! I get it, there are many good use cases for Electron and it's easy to get started with cross platform support, but why is everybody going crazy about text editors in them? Because you can write plugins in JS? Wouldn't it be better to make native application, especially for code editors, where developers spend most of their time, whe…

well if you've ever built a cross platform native desktop application, you will appreciate Electron. Java Swing. Never again. edit: Do people downvoting even know what it's like building cross platform desktop applications using Java Swing? It's fucking awful, and that's a fact. Even the end result UI design look & feel is butt ugly. Sure you can spice things up with JavaFX but why? Do you not realize how masochistic…

I was extremely skeptical of using Swing for a really large hospital application. But after working in it for quite some time, I have to say that with the right approach it is quite manageable. There is plenty of power in there and a lot of good things can be done.

(I do prefer the webstack over Swing)

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#689

The answer to all this is: "use Qt". "But camgunz, I only know JavaScript" That's cool! Look into QML. "But camgunz, I only know X" That's cool too! Qt4 has a truly ludicrous number of language bindings: https://en.wikipedia.org/wiki/List_of_language_bindings_for_... . Qt5 has a fair number too: https://wiki.qt.io/Language_Bindings . "But camgunz, I need an embedded browser" I agree, separate windows are for savages.…

but but camgunz isn't the commercial license like a new house, three kidneys, and your cat?

3,540.00 USD to be exact :P ... each year to be exact :P

Re: VS Code uses 13% CPU when idle due to blinking cursor rendering

#690
post #534

An internet points out that Hackernews' favorite text editor takes up more CPU than the average Hackernews would have had at their disposal 20 years ago just to make the cursor blink on and off. Hackernews circles the wagons to justify the stupid engineering design decisions behind said editor based solely on the fact that embedding a complete Web browser just to draw buttons and text fields "won" over any sensible G…

Best bit is that X11 runs really well these days -- responsive, fast, reliable. Emacs runs great, gitk, xterm, xosview, mplayer window manager, even Firefox is alright. Renoise, Maya, Blender too. Not to mention network transparency when I need it. It's a great environment to get my work done, and 3x hi res displays is the stuff I dreamt of 15 years ago. So it's a good job we're about to throw it all out and start ag…

[deleted]
Post reply on HN