Optimizing perfs in a patch & trying to understand peaks in PerfMeter

Hey all!

I am trying to optimize my LED Mapping patch as much as possible, and am having a hard time trying to understand the peaks I have in the PerfMeter (I am using PerfMeter from Graphics.Skia.Layer and a preview pad).
I know these tools are not necesarily the most accurate but I guess they are a good overview of the overall smoothness and/or culprits in a patch, and obviously something funny is happening under the hood here and I’d like to understand it better :)

Even after having optimized and cached every single thing I could in the processing, I am still seeing regular acute drops in the framerate like so, while I do not have anything happening at such a rate in my patch:

image

  • based on recommendation from @sebescudie I tried to use the process inspector from Visual Studio (“attached without code” to vvvv.exe) to see if it could show a sync with the garbage collector, hopefully pointing at some clumsy instancing that might have remained overlooked somewhere. But the peaks don’t match the GC, that is shown to occur on a way less regular basis (the capture below might not show the most contrast with the PerfMeter curve above since both are pretty erratic here, but most of the time both really show no kind of correlation at all, with usually way more fps downpeaks than GC happening):

Capture d'écran_20240321_193717

But here is where it gets funny:

  • when I delete one by one every single node in my root patch, while it gives a little more relief to the overall framerate (progressing asymptotically around 120fps), the regular down peaks remain
  • even when I have deleted absolutely everything in my patch (except from the PerfMeter itself), the peaks remain (at a pretty intriguingly consistent rate)

  • from this blank canvas, F9 or even Recompiling won’t help

  • if (from the same vvvv active instance) I start a fresh new patch, paste only the PerfMeter, I still have the same curve

  • even (from the same vvvv active instance) if I close all patches, start a fresh new patch, paste the PerfMeter, F9, recompile, etc., the peaks are still here. Whatever I do, it seems the running instance is “doomed” forever with something in the background, in case I ever opened my big patch beforehand.

  • ONLY if I kill vvvv, start again a fresh instance, and paste PerfMeter in a patch, will I get a perfectly stable 120fps.

Does it make any sense?
Any idea what could be behind these pikes, surprisingly even as a zombie when no process node is even running anymore and the patch is even closed?
Is there any more targetted diagnostic tools or tricks I could use to track down the issue?

I’m trying to inverstigate quite thoroughly after suffering some regular freezes (5 secs or so) in my full patch that I cannot relate to any event happening in my processing.

I’m also seizing this opportunity to maybe get a little better at investigating deeper down how to optimize the perfs in a patch.

Thanks for the help!
T

5 Likes

There’s also another view in der VS profiler where you can see a breakdown of all the called methods. But not sure that will give you any clues. Also other tools like dot trace will probably overwhelm you with stuff you have no idea how to relate to.
You could try coming from the other direction: adding nodes one by one until it breaks. This could help you narrow it down.
But since the issue persists after F9 it’s gonna be messy. Probably the first task will be to identify that resource leak / it’s some patch/component in your system which is not getting cleaned up properly.

Just as an aside: I have to regularly restart VVVV (6.0265 ATM) since stuff seems to keep hanging around somehow or getting confused. Like loading several patches and closing some of them and then a skia window from a closed help patch is still there but the stride window from the still open patch isn’t.
Or the dropdown showing my loaded patch several times.
Or certain things just stopping working and F9 doesn’t help at all.
I never was able to nail anything down, but it happens all the time here.

So I could imagine that this kind of thing is happening here also maybe if restarting VVVV solves it?

Cheers,

Tom

@Elias

There’s also another view in der VS profiler where you can see a breakdown of all the called methods.

Thanks, I will look for this more detailled view in the profiler!

You could try coming from the other direction: adding nodes one by one until it breaks. This could help you narrow it down.

Yes, I guess I’ll have to do it node by node and connection by connection indeed…
An exciting weekend in perspective! 😅

@Thomas_Helzle

Just as an aside: I have to regularly restart VVVV (6.0265 ATM) since stuff seems to keep hanging around somehow or getting confused. Like loading several patches and closing some of them and then a skia window from a closed help patch is still there but the stride window from the still open patch isn’t.
Or the dropdown showing my loaded patch several times.
Or certain things just stopping working and F9 doesn’t help at all.
I never was able to nail anything down, but it happens all the time here.

So I could imagine that this kind of thing is happening here also maybe if restarting VVVV solves it?

Yes I definitely can relate to this in my case!
Will report here if I ever happen to spot one the guilty one, hopefully this can help identify such behaviours.

T