News for hackers. Stuff that matters.
Re:Blinking Cursor Turns 54 by jpe90 on Monday January 10, 2022 @04:24PM (#29882780)
“A blinking cursor can have a significant effect on battery life, as such we decided to change the default to non-blinking.”

Sublime Text 4 Update FAQ, May 2021

https://forum.sublimetext.com/t/sublime-text-4-update-faq/58...

Re:Blinking Cursor Turns 54 by fxtentacle on Monday January 10, 2022 @04:37PM (#29882993)
Haha, that's probably an electron app. Or they use a really buggy UI framework. Otherwise, I wouldn't know why updating a 4x8 pixel block would cause a significant amount of power usage. Especially if a 286 could do it no problemo.
Re:Blinking Cursor Turns 54 by zamadatix on Monday January 10, 2022 @04:51PM (#29883174)
Sublime is a native C++ app. It uses a minimal custom framework built on top of I think skia which actually mediates the drawing on hardware devices (or the CPU). As described by the articles the power usage comes from causing the hardware to repeatedly exit a low wattage deep idle state to update the UI not to do with the amount of work required to render the update.

This is actually more noticeable for efficient apps than inefficient/bloated apps as the latter don't get as many chances to enter deep idle states in the first place.

Re:Blinking Cursor Turns 54 by jablan on Monday January 10, 2022 @06:00PM (#29884214)
> repeatedly exit a low wattage deep idle state to update the UI

There's a considerable difference in doing that once a second and dozens (hundreds? thousands? depending on how it was implemented) times a second, which I would assume what the previous default ("smooth") setting meant.

Re:Blinking Cursor Turns 54 by 323 on Monday January 10, 2022 @06:11PM (#29884386)
No, it's caused by modern desktops being composited. Changing a single pixel in a window requires a full surface flush of that window to the GPU.

There are ways around it, but it requires direct interaction with the compositor, which while supported by the APIs, it's more complicated.

Re:Blinking Cursor Turns 54 by hulitu on Tuesday January 11, 2022 @03:11AM (#29888875)
> No, it's caused by modern desktops being composited. Changing a single pixel in a window requires a full surface flush of that window to the GPU.

So evolution. Does this mean that a laptop with lower screen resolution has better battety life ? It explaines why Win 10 is so crappy with screen and cursor updates.

Re:Blinking Cursor Turns 54 by salamandersauce on Tuesday January 11, 2022 @07:02AM (#29890482)
A laptop with a lower screen resolution has entered battery life but that has more to do with the fact you need brighter backlights to get the same brightness from a more dense panel. Pretty common to see 1080p versions of laptops that also have 4K options have significantly more battery life.
Re:Blinking Cursor Turns 54 by ziml77 on Tuesday January 11, 2022 @09:17AM (#29891669)
Exactly why I hate how laptop manufacturers shove 4K displays into laptops just because it sounds impressive. 4K is more dense than any laptop needs (maaayyyybe 17" ones benefit, but at that size they're optimized for performance at the expense of battery life anyway). Would be great if more laptops had resolutions between 1080p and 4K so things can look sharp without being too hard on battery life.
Re:Blinking Cursor Turns 54 by jpe90 on Monday January 10, 2022 @04:54PM (#29883235)
Re:Blinking Cursor Turns 54 by lttlrck on Monday January 10, 2022 @08:09PM (#29885709)
A 286 didn't do anything to flash a cursor in e.g. VGA text mode - the graphics adapter did using a counter controlled by the refresh rate.
Re:Blinking Cursor Turns 54 by csdvrx on Monday January 10, 2022 @05:49PM (#29884045)
The tone of your reply is inappropriate. Any apps that cause a change in the content displayed risk causing wakeups on the GPU.

It's true whether it's a terminal emulator, a browser or an office suite.

GPU power saving loves static content (OLED screens don't, but that's another story)

Re:Blinking Cursor Turns 54 by fxtentacle on Tuesday January 11, 2022 @05:19PM (#29898974)
Combining the replies from zamadatix, jablan, 323, and jpe90, it seems to me like the UI framework is the culprit and could be (should be?) improved.

If using the API's correctly, the compositor can be limited to only updating a small part of the screen. If really only switching the cursor between on and off, that'll happen roughly once per second. And lastly, the whole thing can be skipped completely if the cursor happens to be invisible, for example if the editor is minimized or (partially or fully) obscured by other windows.

Re:Blinking Cursor Turns 54 by SketchySeaBeast on Monday January 10, 2022 @06:00PM (#29884216)
One of sublime's selling points is that it's not an electron app.