Live data from Hacker News

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

github.com

451–460 of 801 posts

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

#451
post #55
post #41

Earlier quoted context omitted.

I think I don't understand the issue well enough. This looks like a standard blinking cursor to me. Users expect a blinking cursor in an editable text field. I'm not sure why this implementation is slow or why they needed to implement it themselves and not let the OS handle the blinking cursor. I'm guessing there must be some reason.

> I'm not sure why this implementation is slow I'm guessing the culprit for that is in this part of the bug report: > Zooming into a single frame, we see that while we render only 2 fps, the main thread is performing some work at 60 fps (every 16 ms) As for > why they needed to implement it themselves and not let the OS handle the blinking cursor They're not editing inside a text editor field anymore, they need to bl…

On Win32[0], the blinking caret can be shown anywhere inside a window, not just on a text field. The sample program builds a basic text editor without cheating and using a textbox control.

I'm sure other operating systems have this kind of facility - after all, how does the built in text edit control draw its caret?

[0] https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...

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

#452

Earlier quoted context omitted.

WPF is perfectly fine for high DPI apps and still beats all this web stuff by orders of magnitude. CSS people still think a grid is a choice of "small" "medium" and "large" columns/rows. Haha.

> WPF is perfectly fine for high DPI apps and still beats all this web stuff by orders of magnitude. > CSS people still think a grid is a choice of "small" "medium" and "large" columns/rows. Haha. CSS Grid is literally Microsoft taking the WPF grid layout and porting it to the Web!

Yes, that is what I'm saying. They are not porting it because previous solutions have been just as capable.

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

#453

Earlier quoted context omitted.

On the flip side, the new Windows "Metro" style calculator app takes several seconds to load ... and is less usable than the old calc.exe.

It takes maybe half a second on my 4 year old Core I5.

Sometimes it does. I've seen this happen on several machines, some containing recent i7s. And if it does "pop up" quick, it has a loading screen. Let that sink in. It actually has a full-colour screen while it figures out how to render a few numbers and buttons. FFS.

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

#454
post #209
post #55

Earlier quoted context omitted.

> I'm not sure why this implementation is slow I'm guessing the culprit for that is in this part of the bug report: > Zooming into a single frame, we see that while we render only 2 fps, the main thread is performing some work at 60 fps (every 16 ms) As for > why they needed to implement it themselves and not let the OS handle the blinking cursor They're not editing inside a text editor field anymore, they need to bl…

I don't believe that any modern browser still supports the blink tag; IIRC Firefox was the last to get rid of it, a year or two ago. You can hack it up in CSS, though.

Truly, the web has come full circle.

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

#455

Earlier quoted context omitted.

> You both do realize that similar arguments could have been made back in the day when moving from, say, command-line DOS applications to Windows API applications - right? No, we don't. With Windows API there's no sandbox and extra embedded language overhead (it's still native code like in DOS, and even optimized better, able to use more available memory than DOS would allow, etc.). Oh, and you also got the benefit o…

> Not to mention that the Windows API UI toolkit, while bad, is sane compared to the web stack. Completely disagree. Charles Petzold's HELLO.C is hundreds of lines of code. Hello World on the Web is, well, "Hello world!". "Sane" environments don't force you to make up a distinction between "long pointers" and "pointers" if you want to conform to the house style in order to match 16-bit x86 real mode. Or route all eve…

HELLO.C in question: https://www.johndcook.com/blog/2014/11/12/hello-world-is-the...

I was unfamiliar.

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

#456
post #29

Earlier quoted context omitted.

The benchmarks make it look bad but to be honest aren't that relevant for day-to-day use. I can't remember the last time I saw performance issues in Atom and the plugin infrastructure massively outweighs the occasional possible issue

The only ever time I see performance issues is when I accidentally click on a binary by accident. Atom's large file handling is awful... But how often do you open a 100MB text file?

When I'm looking at trace files to figure out why an error occurred, I'm happy when I only get a 100MB one to look at.

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

#457
post #438

Earlier quoted context omitted.

Can we cut the "holier than thou" pretentious bullshit? Just because someone uses a different language, or solves different problems doesn't make them worse or any less "hardcore" than you. You are right, the average JS developer might not be able to instantly know the details about how to implement a text buffer, because they don't need to do that on a daily basis. You probably don't know the details about how to im…

This breaks the HN guidelines about civility and not calling names in arguments. Please don't respond to a bad comment with an even worse one.

Fair enough, I'll tone it down next time

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

#458

Earlier quoted context omitted.

> WPF is perfectly fine for high DPI apps and still beats all this web stuff by orders of magnitude. > CSS people still think a grid is a choice of "small" "medium" and "large" columns/rows. Haha. CSS Grid is literally Microsoft taking the WPF grid layout and porting it to the Web!

Yes, that is what I'm saying. They are not porting it because previous solutions have been just as capable.

But they did port it. That's why CSS Grid exists…

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

#459
post #120
post #88

Earlier quoted context omitted.

Google Docs takes a good 2-3 seconds to spin up a UI on my i7. I doubt much of that time is spent building the DOM tree for the UI. Google Docs does a lot more than a simple text editing widget - there's a networked file system, a multi-user collaboration engine, a realtime notification system, etc that all get initialised. Instantiating all that over a network in 2-3 seconds is really fast.

...a whole 2-3 seconds! Sometimes I think that comments like these arise out of not having experienced text-only rendering at 300 baud... I know that's a generalization, and most likely unfair - but damn, today's phones, to this old man, are pocket super-computers (for that matter from my vantage point, an Arduino is a wonder, and a RasPi is utterly amazing)!

I can't remember the stand-up routine, but the punchline applies:

"10secs! I was supposed to be at work 15 seconds ago!"

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

#460
post #336

Earlier quoted context omitted.

C? C++? QT? Java? Any language with GTK hooks? Xamarin? Juce framework? Delphi?? You say 4K and 480p screens like that's hard. Design once, scale forever?

C is unsafe and is too low level. C++ is possibly the only language with more bad parts than Javascript :) Java ok, but how would you run it on iOS? The last viable option for that (RoboVM) was taken behind the shed and shot by Xamarin/Microsoft. GTK doesn't run on mobile and it's barely supported on Windows and MacOS. Xamarin is ok, but it used to be closed source and cost $1000 per year for any serious project. I d…

[deleted]
Post reply on HN