Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th March 2018, 17:31   #21  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Thanks for your reply.

MT_NICE_FILTER crashes, and MT_MULTI_INSTANCE is as slow as not declaring the mode.

Last edited by videoh; 20th March 2018 at 15:39.
videoh is offline   Reply With Quote
Old 20th March 2018, 15:38   #22  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
zimg is used in Vapoursynth so we can't blame this on zimg. Is it just the case that Avisynth+ multithreading is terminally deficient? Or is there some heavy penalty for not having the resizing in the core? Or both? If anyone cares about Avisynth+ there will have to be an answer and resolution.

Last edited by videoh; 20th March 2018 at 18:49.
videoh is offline   Reply With Quote
Old 20th March 2018, 16:37   #23  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,272
Try eliminating dgsource for speed tests.
pinterf is offline   Reply With Quote
Old 20th March 2018, 16:50   #24  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Huh? The same DGSource() executable is used for both Avisynth+ and Vapoursynth testing.

Vapoursynth: 13 seconds
Avisynth+ with z.lib: 45 seconds

Last edited by videoh; 20th March 2018 at 18:21.
videoh is offline   Reply With Quote
Old 20th March 2018, 17:20   #25  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,272
I was asking you for benchmarks w/o dgsource (e.g. using a BlankClip instead) because Avisynth+ runs source filters in MT_SERIALIZED mode.
I don't know how it works in VapourSynth but that can be a difference, which could be eliminated by omitting source filter.
When a source filter would benefit from a specific MT mode, you have to set it for that specific filter manually. It would show then that DgSource with MT_SERIALIZED mode is bottleneck or not.
pinterf is offline   Reply With Quote
Old 20th March 2018, 17:27   #26  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
DGSource runs fine in MT_MULTI_INSTANCE but it makes no difference. I'll try with blank clip.
videoh is offline   Reply With Quote
Old 20th March 2018, 17:31   #27  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
DGSource is actually handled as source filter inside VS's avisynth wrapper: https://github.com/vapoursynth/vapou...ompat.cpp#L378, so it should not be a bottleneck for tests.
__________________
Me on GitHub
PC Specs: Ryzen 5950X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 20th March 2018, 17:53   #28  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
With BlankClip (specifying 10000 frames at 1000 fps and playing in VirtualDub2, just the format conversions):

Vapoursynth 14 sec
Avisynth+ 22 sec

The difference is not as large but is still quite significant. So there is a pure penalty in the conversions and another penalty in the handling of the source filter.

Setting DGSource MT_NICE_FILTER or MT_MULTI_INSTANCE makes no difference (DGSource is actually thread safe and CUVID supports multiple instances). So why does Vapoursynth apparently not suffer these penalties while Avisynth+ does? I tried a large value in SetMemoryMax() but again it made no difference.

Don't get me wrong; I've been a stalwart supporter of Avisynth(+) since year 2000 and have greatly appreciated your efforts along with everyone else. I just want to be able to continue using it in the UHD world.

MAGA (Make Avisynth Great Again)

Last edited by videoh; 20th March 2018 at 18:23.
videoh is offline   Reply With Quote
Old 20th March 2018, 18:02   #29  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,262
Are the speed test results from playing the same avs script in Avs+ and Vapoursynth, or, is it the avs script using z.lib vs Vapoursynth using internal conversion ?
If it's the second case, one possible explaination would be that the conversion is just faster in Vapoursynth than z.lib.
You're not alone thinking z.lib conversion is slow, also here.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 20th March 2018, 18:19   #30  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Interesting, thanks for that confirmation.

It's the second case, of course. But avsresize (z.lib) is basically just a wrapper around zimg, and zimg is used by Vapoursynth. The difference I guess is in invoking it in the core versus an external filter. Hopefully pinterf can shed some light on things for us. zimg could be added to the Avisynth+ core. Things take time, it's not a surprise.

Last edited by videoh; 20th March 2018 at 18:40.
videoh is offline   Reply With Quote
Old 20th March 2018, 20:03   #31  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,530
Quote:
Originally Posted by videoh View Post
Interesting, thanks for that confirmation.

It's the second case, of course. But avsresize (z.lib) is basically just a wrapper around zimg, and zimg is used by Vapoursynth. The difference I guess is in invoking it in the core versus an external filter. Hopefully pinterf can shed some light on things for us. zimg could be added to the Avisynth+ core. Things take time, it's not a surprise.
Nope, no "core" magic there. It's just an internal plugin and nothing more. No secrets.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 20th March 2018, 20:23   #32  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Seems that Avisynth has reached end of life, but what do I know?
videoh is offline   Reply With Quote
Old 20th March 2018, 21:23   #33  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,262
Is the actual build of z.lib up to date with the zimg version ? Does Vapoursynth and this z.lib use the same zimg version ?
__________________
My github.
jpsdr is offline   Reply With Quote
Old 20th March 2018, 21:35   #34  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
I rebuilt avsresize with the the latest version of zimg:

https://github.com/sekrit-twc/zimg
videoh is offline   Reply With Quote
Old 20th March 2018, 22:53   #35  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,285
Were those observations based on your rebuilt avsresize, or "avsresize-r1c" provided in the 1st post ? or same results ?
poisondeathray is offline   Reply With Quote
Old 20th March 2018, 23:15   #36  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,583
Quote:
Originally Posted by videoh View Post
Seems that Avisynth has reached end of life, but what do I know?
you say that just because one filter run faster in vs?! there are another cases that avs is faster like https://github.com/Khanattila/KNLMeansCL/wiki/Benchmark

I think there are something in avsresize dll that case that slowness
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 20th March 2018, 23:52   #37  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,209
Apart from the fact that the benchmark is for 1080p, and not 4K as is being discussed, it actually shows that vpy can handle formats, channels and precisions that avs can't
gonca is offline   Reply With Quote
Old 21st March 2018, 02:35   #38  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by poisondeathray View Post
Were those observations based on your rebuilt avsresize, or "avsresize-r1c" provided in the 1st post ? or same results ?
Results are the same for both.
videoh is offline   Reply With Quote
Old 21st March 2018, 07:00   #39  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,285
How about avsmeter diagnostics ? changing prefetch values ? - check memory / cpu usage etc... is "prefetch(8)" the "best" number in that situation ? Personally I like the auto threading of vpy better.

Can you double check some other measurement tools? maybe vspipe to ffmpeg, vs. avs to ffmpeg for example .

I'll try to compare some other operations in avs vs. vpy tomorrow for z.lib/zimg , if sekrit-twc / s.savage doesn't post by then

Last edited by poisondeathray; 21st March 2018 at 07:04.
poisondeathray is offline   Reply With Quote
Old 21st March 2018, 09:25   #40  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,272
Quote:
Originally Posted by videoh View Post
With BlankClip (specifying 10000 frames at 1000 fps and playing in VirtualDub2, just the format conversions):

Vapoursynth 14 sec
Avisynth+ 22 sec

The difference is not as large but is still quite significant. So there is a pure penalty in the conversions and another penalty in the handling of the source filter.

Setting DGSource MT_NICE_FILTER or MT_MULTI_INSTANCE makes no difference (DGSource is actually thread safe and CUVID supports multiple instances). So why does Vapoursynth apparently not suffer these penalties while Avisynth+ does? I tried a large value in SetMemoryMax() but again it made no difference.

Don't get me wrong; I've been a stalwart supporter of Avisynth(+) since year 2000 and have greatly appreciated your efforts along with everyone else. I just want to be able to continue using it in the UHD world.

MAGA (Make Avisynth Great Again)
Thanks, the difference is still big, worth investigating when I have time.
pinterf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:31.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.