I'm pulling my hair out over a performance issue in Ignition 8.1.47. When I try to navigate away from certain pages, everything freezes up for 30-60 seconds! Yes, you read that right - up to a full minute of completely frozen client. And it happens even on high-performance machines, so it's not una questione di hardware.
Here's what I'm working with:
About 10 identical templates on a page
Each template has a pretty complex structure with nested groups:
9 main groups (let's call them "groups B")
Each of those has 6 subgroups ("groups A")
And each subgroup has 6-10 shapes with gradients
Only one main group and 2-3 subgroups are visible at any time
For controlling visibility, I'm using script bindings tied to a custom property (just a simple int). Each template also has its own timer for blinking effects since I'm using gradients and can't use the Style Customizer.
The strange part is that everything works fine during normal operation - it's only when I'm trying to leave the page that it grinds to a halt. The client just seems to freeze up completely.
I've been monitoring CPU usage which looks normal, and the gateway performance is fine too. I checked with VisualVM and noticed tons of logging activity during these transitions, and then the client logging just stops during the freeze.
Has anyone else run into something like this? I'm thinking maybe it's related to how I'm handling the visibility or perhaps all those timers are causing problems when the page tries to unload.
Any tips or tricks you've learned for dealing with complex templates would be super appreciated!
That means runScript. Whatever you do in that will run on the Vision foreground thread, and any stalls (sleeps, network access including gateway calls, jython timers) will freeze the UI.
You should look to see if you are getting foreground stall automatic thread dumps in your ~/.ignition folder. That will help you track down which script is your immediate problem. (But this kind of foreground thread abuse tends to come in multiples...)
Are you running this vision client in a window, which is smaller (even a little) than the size of configured screens?
Try to resize the client to be a little bigger than the configured screens... for example if you have a screen defined as 1920x1080, resize the client window to lets say 2000x1100, and try to close/open another screen...?
I actually meant the expressions with bindings to various properties of the groups and templates.
Is it possible to use multiple threads in Vision to handle this kind of work?
Or could you kindly suggest some best practices for managing "polymorphic" templates like in this case?
These are pump templates that change their drawing based on the pump type, and change the drawing color based on status. This forces me to have many shapes with different colors.
I've been very careful about that actually. The page is 1920x910 because I have a header and footer, and the entire project layout is set for full HD 1920x1080.
I reduced the template size to work more comfortably - the default template size is 200x200, but I then resize it to 90x90 for actual use.
runScript? If so, give us more details about this. There's probably a better way.
These could be consolidated (and also synchronized) by using a tag binding instead and moving the timer out to the window. The timer would simply drive the tag value.
Yeah, you need to provide concrete details of your project, or obtain thread dumps (which as Phil mentioned, should be automatically being logged). This is classic "something is blocking the event dispatch thread" behavior, which 99% of the time is "someone wrote one or more scripts doing inappropriate blocking work". But the only way to troubleshoot meaningfully is to know which script is hanging things up.