Quote:
Originally Posted by Groucho2004
I'm sure pylorak had a good reason for that commit, if I recall correctly it was related to MT functionality.
|
Early 2014 was when the MT functionality was being implemented and the caching behavior was refactored in tandem with it. That's almost certainly the reason, even if just tangentially.
I mean, the other thing to point out is that the tests are being run single-threaded, and some of that syntax is wonky (probably minuscule in any possible performance detriment, but whatever). Actually
using MT shows how artificial this test is in the first place, because it scales with # of cores in virtually 1:1 fashion.
Script (
with the cruft trimmed out and clarified):
Code:
clp = FFVideoSource("test.avi").ConvertToRGB24()
a = clp.Trim(20,-30)+clp.Trim(2000,-30)
a1 = a+a+a+a+a+a+a+a+a+a
a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1+a1
Prefetch(4)
Without Prefetch:
Code:
>avsmeter test.avs
AVSMeter 2.9.6 (x86) - Copyright (c) 2012-2019, Groucho2004
AviSynth+ 0.1 (r2883, MT, i386) (0.1.0.0)
Number of frames: 12000
Length (hh:mm:ss.ms): 00:08:20.500
Frame width: 196
Frame height: 88
Framerate: 23.976 (24000/1001)
Colorspace: RGB24
Frames processed: 12000 (0 - 11999)
FPS (min | max | average): 381.3 | 2361 | 1977
Process memory usage (max): 44 MiB
Thread count: 16
CPU usage (average): 35.7%
Time (elapsed): 00:00:06.070
With Prefetch(4):
Code:
>avsmeter test.avs
AVSMeter 2.9.6 (x86) - Copyright (c) 2012-2019, Groucho2004
AviSynth+ 0.1 (r2883, MT, i386) (0.1.0.0)
Number of frames: 12000
Length (hh:mm:ss.ms): 00:08:20.500
Frame width: 196
Frame height: 88
Framerate: 23.976 (24000/1001)
Colorspace: RGB24
Frames processed: 12000 (0 - 11999)
FPS (min | max | average): 2164 | 12104 | 10044
Process memory usage (max): 51 MiB
Thread count: 20
CPU usage (average): 57.5%
Time (elapsed): 00:00:01.195
64-bit results, for good measure:
Without Prefetch:
Code:
>avsmeter64 test.avs
AVSMeter 2.9.6 (x64) - Copyright (c) 2012-2019, Groucho2004
AviSynth+ 0.1 (r2883, MT, x86_64) (0.1.0.0)
Number of frames: 12000
Length (hh:mm:ss.ms): 00:08:20.500
Frame width: 196
Frame height: 88
Framerate: 23.976 (24000/1001)
Colorspace: RGB24
Frames processed: 12000 (0 - 11999)
FPS (min | max | average): 948.1 | 2770 | 2303
Process memory usage (max): 25 MiB
Thread count: 16
CPU usage (average): 39.1%
Time (elapsed): 00:00:05.211
With Prefetch(4):
Code:
>avsmeter64 test.avs
AVSMeter 2.9.6 (x64) - Copyright (c) 2012-2019, Groucho2004
AviSynth+ 0.1 (r2883, MT, x86_64) (0.1.0.0)
Number of frames: 12000
Length (hh:mm:ss.ms): 00:08:20.500
Frame width: 196
Frame height: 88
Framerate: 23.976 (24000/1001)
Colorspace: RGB24
Frames processed: 12000 (0 - 11999)
FPS (min | max | average): 1767 | 13659 | 11223
Process memory usage (max): 32 MiB
Thread count: 20
CPU usage (average): 55.7%
Time (elapsed): 00:00:01.069
With Prefetch(5):
Code:
>avsmeter64 test.avs
AVSMeter 2.9.6 (x64) - Copyright (c) 2012-2019, Groucho2004
AviSynth+ 0.1 (r2883, MT, x86_64) (0.1.0.0)
Number of frames: 12000
Length (hh:mm:ss.ms): 00:08:20.500
Frame width: 196
Frame height: 88
Framerate: 23.976 (24000/1001)
Colorspace: RGB24
Frames processed: 12000 (0 - 11999)
FPS (min | max | average): 1692 | 139899 | 23581
Process memory usage (max): 33 MiB
Thread count: 21
CPU usage (average): 34.1%
Time (elapsed): 00:00:00.509
If I up the Prefetch value on the 32-bit test to 5 (one higher than the number of cores in this J3455), avsmeter then reports that it's too short to measure. 64-bit hits the same barrier at Prefetch(6). Of course, that's for 12000 frames at a frame size of 196x88; who knows how much more you can abuse the frame threading beyond
n cores with frames at a normal size and runtime length.