View Full Version : AviSynth+ thread Vol.2
qyot27
31st May 2026, 16:46
Could avsmeter simply be reporting OS thread initialization?
It looks more like thread pool with size of the total logical threads is initialized and locked even if it's not used.
I tested with 20 logical threads CPU and got 24 threads - 20 threads pool (1 per logical thread) + 4 threads for baseline processes (AVSMeter main thread, AviSynth core management, OS memory/caching threads).
pinterf
1st June 2026, 08:17
My figures are 22 threads with 8 core/16 logical processors (i7-11700)
pinterf
1st June 2026, 08:33
Status update: I'm currently integrating the (hopefully final) AVX-512 resampler implementations based on DTL's code and ideas (detailed speed tests and their evaluation and the million of small tuning trials require a lot of work and time), along with a few extra tweaks and fixes.
Beyond this, I don't really want to add any more new features into current version, unless of course when an annoying new bug or an extremely challenging feature request pops up.
jpsdr
1st June 2026, 09:02
It looks more like thread pool with size of the total logical threads is initialized and locked even if it's not used.
If it was the case, the number of threads shouldn't increase when Prefetch is used. But as you see in my post, the number of threads increases according the value of Prefetch, meaning, and it's a good thing, that the prefetch threadpool size is just tuned according the prefetch value.
pinterf
1st June 2026, 12:09
I suppose that the default thread pool, which is always created, would serve the possible (not-so-widely-used and never really finalized) IScriptEnvironment2 entries:
(from Avisynth.h: )
virtual IJobCompletion* __stdcall NewCompletion(size_t capacity) = 0;
virtual void __stdcall ParallelJob(ThreadWorkerFuncPtr jobFunc, void* jobData, IJobCompletion* completion) = 0;
Unlike some other former IScriptEnvironment2 calls, I did not dare to pull these two back to our standard IScriptEnvironment.
Prefetcher's threading is an addon on top of this.
Moreover: multiple Prefetch oocurencies in the script with different thread count specification will start their own prefetch thread pool.
jpsdr
1st June 2026, 13:39
Ah...! I forgot this one existed !
Now it make sense.
My figures are 22 threads with 8 core/16 logical processors (i7-11700)
Did you test with completely empty default plugins folder?
I too have two extra threads when I have plugins in the default plugins folder (autoloading path).
pinterf
1st June 2026, 17:13
Did you test with completely empty default plugins folder?
I too have two extra threads when I have plugins in the default plugins folder (autoloading path).
No, I'm full with autoloaded plugins, it was just a quick out-of-box test.
jpsdr
1st June 2026, 18:06
Is possible... no is it easy to make something (like using a "first time boolean") to create/allocate this threadpool only if the feature is used, for exemple on the first call of ParallelJob (or any similar feature function) ?
pinterf
22nd June 2026, 17:19
New build: AviSynth+ r4626
https://github.com/pinterf/AviSynthPlus/releases/tag/v3.7.6pre-r4626
Featuring a tweaked AVX-512 (both base and "fast") resampler update. Thanks to DTL for his implementation and ideas, which I then tweaked further to achieve more speed and acceptable performance with MSVC and for AVX-512 baseline (pre-Ice-Lake) as well. This part is a massive update; no wonder it took a year to reach this point (though with large gaps in the timeline when I had no time or was overwhelmed by the continous code changes). The development process was like an evolution: to see what worked, at least four times as many candidate ideas were implemented, many of which ultimately didn't make the cut.
Aside from this, there are no new features, mainly two reported bug fixes and other regression fixes that I uncovered here and there.
StainlessS
22nd June 2026, 18:11
Lots of work there P, great Respect ensues.
Thanks muchly :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.