Log in

View Full Version : Wasted MT Effort?


Danette
14th March 2022, 02:40
I’ve been trying to optimize MT use in Avisynth, but am struggling to get value out of it.

I’m using a QTGMC script line on a d2v file. I have four physical cores (plus, I believe, 4 virtual cores) for a total of 8 threads. When I run the script through AVSMeter, I get the expected speed benefits, and increased CPU utilization, as I move from no MT up to 7 threads (Prefetch(7)).

However, when I process it through MeGUI (x264), at best I get equal encoding time among the threads and, often, do best with no MT at all. Am I right that the reason for this is that x264 utilizes nearly 100% CPU usage, leaving no room for any speed improvements derived from script multithreading?

StainlessS
14th March 2022, 12:23
I have [i7-8700] 6C 12T, and with x265 find marginally faster (my standard encode script, with many settings) at Prefetch(3),
although I usually use Prefetch(4). Almost same speed Prefetch 3 to 6.
I usually get about 80% -> 100% CPU usage, encoder is heavy on CPU. (Source drive is nvme SSD.)
Just use whatever you get best encode speed at.

Atak_Snajpera
14th March 2022, 13:07
I’ve been trying to optimize MT use in Avisynth, but am struggling to get value out of it.

I’m using a QTGMC script line on a d2v file. I have four physical cores (plus, I believe, 4 virtual cores) for a total of 8 threads. When I run the script through AVSMeter, I get the expected speed benefits, and increased CPU utilization, as I move from no MT up to 7 threads (Prefetch(7)).

However, when I process it through MeGUI (x264), at best I get equal encoding time among the threads and, often, do best with no MT at all. Am I right that the reason for this is that x264 utilizes nearly 100% CPU usage, leaving no room for any speed improvements derived from script multithreading?

Yes, you are right. Encoding process is a "bottleneck" here. Basically x264 does not need frames that quickly from decoding process hence encoding speed remains the same. However the story would be different if you had something with larger number of cores (16 or more)

coolgit
14th March 2022, 20:29
The size of the file matters too. When encoding 10GB or more, CPU rarely hits 100% unless there is a lot of encoding per frame. Otherwise it would hover around 60% as the HDD can't work fast enough. If I encode from my NVME SSD and save to HDD I can get 95% on my CPU.