News for hackers. Stuff that matters.
Re:Blinking Cursor Turns 54 by csdvrx on Monday January 10, 2022 @03:16PM (#29881530)
Interestingly enough, disabling cursor blinks on the intel 950 iGPUs resulted in increased powersaving: https://lwn.net/Articles/317922/ and http://tuxdiary.com/2015/09/29/save-battery-intel-linux/

A few years later, I checked that with powertop when I was using my thinkpad in uni and it was true and measurable!

I'm not sure if it's still the case, but it's funny how UI features can tax the power budget in unsuspected ways.

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.
Re:Blinking Cursor Turns 54 by newsbinator on Monday January 10, 2022 @03:19PM (#29881574)
And moving your mouse around made Windows 95 faster!

https://www.extremetech.com/computing/294907-why-moving-the-...

Re:Blinking Cursor Turns 54 by chhickman on Monday January 10, 2022 @03:37PM (#29881959)
You can still observe a related effect to this in Windows 10. Open up any large(ish) file in NotePad++ or most any other editor and place the cursor in the text and drag to the bottom of the screen so it starts scrolling. If you hold the mouse still at that point it will scroll through a couple dozen every half second or so, but if you wag the mouse side to side it will scroll through hundreds at a time in the same span.
Re:Blinking Cursor Turns 54 by munificent on Monday January 10, 2022 @05:10PM (#29883476)
I always assume that it's because the apps simply scroll on both timer events and mouse move events. Wiggle the mouse to raise a bunch of mouse move events and you get faster scrolling.
Re:Blinking Cursor Turns 54 by jareklupinski on Monday January 10, 2022 @04:03PM (#29882407)
every time I use this trick, I think of how running diagonally in some games is faster than running in one direction...
Re:Blinking Cursor Turns 54 by badRNG on Monday January 10, 2022 @04:56PM (#29883270)
I think that's just because those games are written poorly and don't account for the differences in moving diagonally. If you are moving on a grid, moving forward one tile moves you the length of a tile. Moving diagonally one tile moves you sqrt(2) ~1.4 tile lengths.
Re:Blinking Cursor Turns 54 by Akronymus on Tuesday January 11, 2022 @06:47AM (#29890342)
More often it is because both inputs apply some speed. Like in doom.

https://doom.fandom.com/wiki/Straferunning

Re:Blinking Cursor Turns 54 by adamrezich on Monday January 10, 2022 @05:55PM (#29884134)
always normalize your input vectors!
Re:Blinking Cursor Turns 54 by franga2000 on Monday January 10, 2022 @04:26PM (#29882817)
Yeah people always look at me like I'm crazy when I do that, but it really does work
Re:Blinking Cursor Turns 54 by reaperducer on Monday January 10, 2022 @03:57PM (#29882303)
And moving your mouse around made Windows 95 faster!

Still the case with macOS in Finder. Even on Big Sur running on an M1. I dealt with this over the weekend.

Re:Blinking Cursor Turns 54 by bitwize on Monday January 10, 2022 @03:50PM (#29882189)
Remember when Visual Studio Code consumed 13% of one CPU core to blink the cursor?
Re:Blinking Cursor Turns 54 by mbg721 on Monday January 10, 2022 @05:26PM (#29883720)
Any idea what the processor cost of hitting "insert" and having the big rectangular cursor was?
Re:Blinking Cursor Turns 54 by csdvrx on Monday January 10, 2022 @05:50PM (#29884061)
The shape of the cursor isn't the problem - the fact that the shape regularly changes when blinking is.