ATVO works very slow

Posts: 52
Hello good Morning!

I have recently been testing a new NASCAR overlay that we are building for our next championship, but for some reason loading it all slows down in ATVO. I don't exactly understand the reason, because I have checked the performance of my PC and the usage rates are not high. I tried lowering the iRacing graphics settings, and things got better, but it was a really insignificant improvement.

I really do not know if there is any way to solve this since I truly believe that this is not because my PC does not meet the conditions to make ATVO work correctly
Posts: 785
Do you use a lot of scripts? Can you check the script performance tab if they are running slow? Can you check the error log if they are throwing constant errors? That is the most common culprit for slow performance.

If not, please send us the theme by email and we'll take a look.
Posts: 52
No, I only use one to show in the time column when a driver is in the pits or has retired.

I just sent you the Overlay by mail (info@appgineer.in) to see if you can give me a hand, thank you very much in advance
Posts: 52
After sending you the Overlay I checked to remove the Script to check the performance and now it works really well.

But I would love to keep that script since it shows useful information about when a driver is in the pit or has retired ... I would not like to lose it. : '(
Posts: 785
I did not receive the theme. Can you try info@appgineering.com instead? Or paste the script here.

Most likely a small fix to the script will fix the performance, I have seen it many times. Can you check your error log (in the theme with the script) to see if it's constantly giving errors? That is slowing down the theme. You should prevent scripts throwing errors as much as possible by doing your own error checking.

Most common example is that the input to the script is empty (null) and you don't check for that.
Posts: 52
I just resent it

From what I could see, the script did not throw any errors, but it was not a very exhaustive test
Posts: 52
Hello again!

First of all, apologize for being such a repeat offender. I've been doing even more testing, and even removing the script from the ATVO overlay still slows down a lot. I cannot select the time table to which pilot I want to see, it takes 3 to 4 seconds to react, and as I said before, my PC's usage values ​​do not exceed 50% ...

The truth, I am somewhat desperate
Posts: 287
Try this on the top of your script (only if and return, the top is to show you were put it)
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
if (value == null)
{
      return null;
}


We met this problem with others and it solve.
Edited (2 times)
Posts: 52
Emmanuel Suter wrote:
Try this on the top of your script (only if and return, the top is to show you were put it)
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
if (value == null)
{
      return null;
}


We met this problem with others and it solve.

I can't integrate it and make it work with my script ...

I'm going to put my script here to see if it can be optimized in some way

using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;

namespace Scripts
{
public class Script : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
var result = value as IEntitySessionResult;
if (result == null)
return null;

if (result.DidNotStart == true)
return "DNS";

if (result.Out == true)
return "DNF";

if (result.Entity.Car.Movement.IsInPits == true)
return "PIT";

if (result.Finished == true)
return "FINISH";



return "";
}
}
}
Posts: 785
The issue is not with your script. I think the main issue is that all of your widgets are full-size widgets, with an image that only takes up a small part of the screen. That is unfortunately quite bad for performance due to the way the widgets are rendered.

Please read this: https://atvo.appgineering.com/Forum/Thread/180

I can imagine it is a lot of work to rebuild your theme like this. I will see if I can improve this situation but I cannot promise anything yet.
Posts: 52
Well sure it's a lot of work, but if it's the right way to make everything work its best then I'll do it!

Thank you very much for your help and your time.
Posts: 785
Before you invest hours into this, let me first double check the root cause of the issue. I cannot guarantee that doing it will completely solve the problem, perhaps it is something I have to fix...
Posts: 785
I will pick this conversation up with you over email to avoid flooding the forums with details, and I'll post here again if we find a solution!
Posts: 785
I believe version 1.33.3 (beta) or 1.34.2 (alpha) should fix this issue! Thanks for bringing it to my attention.

It may also fix similar issues in other themes, although I did not fully figure out what conditions cause it to trigger exactly.
Posts: 52
Wow!

I don't know what you've done, but this works really well now.

Thank you very much for all the attention you have given me and for helping me to solve everything, I am really grateful for your dedication
Posts: 287
So Nick you find something to support more or large picture into widget or subwidget?
Posts: 785
Emmanuel Suter wrote:
So Nick you find something to support more or large picture into widget or subwidget?
Do you mean that you can make all your widgets full-size even if they only cover a small part of your theme?

In the end, this was not the cause of the issue in this particular case. So we still "support" that, I just don't recommend it. It still has a performance impact, just smaller. And in case you use the "v1" version of NDI it has a very large performance impact (not with v2 though).

In general it's not a good idea, so avoid it if you can.
Posts: 287
No, i don't use full size widget, never. But I had to rebuild some ticker without dynamic picture cause that slow the system. I had to test this new build.