Set a lower CPU process priority for batch conversions

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

corr
Posts: 134
Joined: Tue Jun 13, 2017 8:00 am

Set a lower CPU process priority for batch conversions

Post by corr »

Batch conversions can take several minutes, especially when converting to jxl/avif. These run as a process with the normal CPU priority level, which has a negative effect on other programs by making them hardly usable during the process. It is possible to set this in the process explorer, but this is only a poor workaround if these conversions occur frequently and xnview is closed in between. Then you have to do it again every time. For this reason, I would like to see a function in XnView that can downgrade the CPU priority for the process.

Relates to:
viewtopic.php?f=82&t=43247&p=196614
User avatar
m.Th.
XnThusiast
Posts: 1676
Joined: Wed Aug 16, 2006 6:31 am

Re: Set a lower CPU process priority for batch conversions

Post by m.Th. »

You can limit the number of cores and this has the same (if not better) effect.
m. Th.

- Dark Themed XnViewMP 1.7.1 64bit on Win11 x64 -
corr
Posts: 134
Joined: Tue Jun 13, 2017 8:00 am

Re: Set a lower CPU process priority for batch conversions

Post by corr »

I have experimented with both variants. Setting a lower CPU priority level has significantly less negative effects for me when working in parallel than if only the number of CPU cores is reduced. In addition, the resources are used less efficiently.
bul
Posts: 7
Joined: Sun Dec 16, 2018 9:19 am

Re: Set a lower CPU process priority for batch conversions

Post by bul »

Hi,

i also vote for CPU-Priority setting.
My 4 Core system becomes pretty unusable when doing 3 conversions at a time to avif.
When I manually set cpu priority to idle (even at 4 core use), the system is fluent AND the whole conversion is FASTER, because of using all cores (at lesser percentage).

So i plead for such an option. Please.
bul
Posts: 7
Joined: Sun Dec 16, 2018 9:19 am

Re: Set a lower CPU process priority for batch conversions

Post by bul »

Bump.

I still plead for CPU-Priority settings, because I noticed that using all CPUs with idle is faster (and system still usable) than using less cpus.
I hope programmers of xnview can understand why and why we went this feature. :)
bul
Posts: 7
Joined: Sun Dec 16, 2018 9:19 am

Re: Set a lower CPU process priority for batch conversions

Post by bul »

@xnview
Any Comment on that? I still have to manually set CPUpriority to idle before every batch convert.
If I forget, System becomes almost unusable. Even if using only 3 cores on a 4 core system.

As a workarround I created a shortcut (right mouse on desktop, create shortcut) calling cmd.exe that runs startcommand with /low parameter. Its not idle but probably good enough.
Screenshot is german, but i am sure anyone who want to set cpu priority will understand.
Ah and I also changed icon from the shortcut to look like the one from xnconvert.
Unbenannt.JPG
Unbenannt2.JPG
If you have same directorystructure like me, you can copy n paste command for shortcut (I am on 64 Bit System and it works):
C:\Windows\System32\cmd.exe /c "start /low xnconvert.exe"
You do not have the required permissions to view the files attached to this post.
purpleguy
Posts: 5
Joined: Wed Mar 16, 2022 3:28 pm

Re: Set a lower CPU process priority for batch conversions

Post by purpleguy »

This would be a useful feature, indeed. The nuanced difference vis-a-vis "# of CPU cores" is also something the typical user might not understand, but developers, power users, etc. they'll definitely understand the elegance of cpu priority as an adjunct resource arbiter. In my case, it would find utility almost every day. For example, I wouldn't have to fiddle with the # of CPU cores I choose to allocate nearly as much as I do if this were implemented. I could leave it at perhaps 8, instead of manually adjusting it each time to something like 2 or 4, when I have an important x265 or other encode occuring concomitant with say a 7-zip archive creation, Topaz Video Enhance AI, etc. etc. I keep my 16 cores occupied as much as possible, and manage the processes thereon in a manner that provides a good measure of responsiveness despite. This is merely dreaming, however, I've got no problem with the current setup since I eat, sleep, & breath the kind of hands-on diligence that sees all these variables well-managed with the tools already provided. As clearly does OP. But why not dream? :) The software author spoils us. :)
cday
XnThusiast
Posts: 4136
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Set a lower CPU process priority for batch conversions

Post by cday »

Evidently could be useful... :D

But meanwhile a possible workaround might be to use XnConvert for batch conversions with fewer cores enabled.
purpleguy
Posts: 5
Joined: Wed Mar 16, 2022 3:28 pm

Re: Set a lower CPU process priority for batch conversions

Post by purpleguy »

I've always got some unreasonably large PNG files that could do with a more efficient lossless format such as AVIF. Let's see how well OP's method works... by the way, I find PNG -> AVIF (Speed 3) to be about -38% file size on average. I'd like to someday losslessly transcode my JPG files as well using the lossless JPEG-XL conversion, is anybody aware of how to do that within XnView MP or is that particular nifty oddity of JPEG-XL not implemented?

Anyway back to the topic: After trying OP's suggestion, my testing shows XnView does yield quite nicely to higher priority tasks, as it should. I had some theoretical doubt, since I couldn't remember if XnView spins off the transcoding to external daughter processes which might not inherit the Low priority necessarily... but it seems that XnView keeps it all quite internal. Always nice when the universe is orderly and works as we expect. Handbrake and XnView MP (while doing monumental batch conversions) will both be at Low priority which is just perfect for my orchestra of cpu intensive applications ... which I always run simultaneously because of the luxury that competent companies such as AMD & TSMC afford me. I'm glad we have those guys. I had some high hopes for Mr. Gelsinger but I fear he just won't be able to steady the ship in time to avert quite some pain.