Jump to content

Selection indicator uses CPU for invisible tabs


Recommended Posts

I have a i5-3427U CPU @ 1.80 Ghz and an Intel HD 4000 internal graphics card.

 

The selection indicator is the blinking line around a selected area in an image. E.g. it is drawn after the selection tool was used.

 

The implementation of the selection indicator is pretty poorly implemented regarding performance. Just follow those steps to reproduce:

 

  1. Monitor your taskmanager while doing the following steps
  2. Get any image data into your clipboad, e.g. make a screenshot
  3. Do Ctrl-N, Ctrl-V many times in Paint.net
  4. You will see, the CPU usage increases on each image

 

  • CPU usage shouldn't increase each time a new image tab is opened. The thread should stop on the other tabs that aren't visible
  • CPU usage keeps constantly high if I have another window shown above Paint.net. Some days my fans are blowing the whole day due to high constant CPU usage until I realize that Paint.net is the cause once again.
  • If I do Ctrl-D in each image tab, CPU usage goes to nearly 0% again
  • If I minimize the window, CPU usage is almost 0%. But in my normal work routine I never minimize windows. I rather put other windows above.
  • The selection indicator shouldn't use that much CPU power in the first place. There must be a much more efficient way available to implement it
  • Last but not least: Guys, you have so many installations out there. That fix will reduce the global energy consumption! Think green...

 

Link to comment
Share on other sites

4.2.14 will cut the CPU usage by 50% if you're not using GPU accelerated rendering (which you can toggle in Settings). Your GPU may be in the list of those which are blocked because they had bad drivers circa 2014 (when 4.0 was released). You might try turning it on, which will give you a huge decrease to CPU usage (almost down to 0%).

 

I'll go and double check the code to make sure inactive tabs aren't still running the animation for the selection outline.

 

There has been a lot of work put into the performance of the selection outline, despite your statement otherwise :) This may just be an oversight, but I have to go and verify it.

 

Also, unfortunately, I've been unable to find a way to determine that the Paint.NET window is occluded (covered up). Windows doesn't seem to provide a way to query this (and I've even asked Microsoft engineers). So that part just can't be optimized at this time. Minimizing the window, or disabling Animations in the Settings dialog, will certainly improve things here.

 

I get enough folks telling me they're affected by this that it may make sense to just turn off the animation whenever the window isn't active. Chewing up batteries and CPU fans isn't the goal of the selection outline animation.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 1 month later...

my system.txt

 

Seems like you fixed it. I have paint.net 4.2.14 (Final 4.214.7601.39231) running and I can't reproduce the high CPU usage anymore.

 

As you can see in the attached text file, I have a system from 2012. My assumption was that you require a certain WDDM (https://de.wikipedia.org/wiki/Windows_Display_Driver_Model) version which my system doesn't support.

 

 I just checked in the settings. Hardware acceleration is enabled.

 

Link to comment
Share on other sites

Yes, I changed this in 4.2.14. Animations, including the selection outline, are now only active when Paint.NET is the active window.

 

This has/had nothing to do with WDDM or driver versioning.

  • Like 1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...