Very slow load time on page displaying large Template repeater

I have a screen with utilizes the template repeater pretty heavily. The dataset I’m feeding the repeater has ~350 rows. Each repeater then displays 10 tags, so the screen is loading some 3500 tags. This screen takes 20-60 seconds to load and my client isn’t to keen on that.

The only solution I can think of is load this screen in the background at startup and then drop it to the background when navigating to other screens instead of closing and then opening . Is there anything I can do to help speed this up?

How are you displaying the tags? Individual components on the templates each bound to a tag?

Yes that’s how I’m doing it. I pass in the tag root folder and then the individual components use indirect tagging.

I would first build a list of tags you want to read then use system.tag.readAll to read them at one time. Then the individuals components can be bound to values in the resulting dataset.

Thanks! Would you still do this as a template repeater? So I’d have a system.tag.readAll() for the 10 tags per line in the repeater?

Before you rip your template apart, try adding a dummy Tag Change Script under Client Events that subscribes to all of those tags. The script would do nothing, but tag listeners would be established at client startup that would keep those tags current in the client all of the time. Your window should then open much faster.

1 Like

Exactly, or you can even read all the tags you need for every template at once and pass a dataset with the values to each template if you are feeling adventurous.

You can also try pturmel’s suggestion if you and anyone else who ever touches the project will remember where to add, remove, and change tags in the future.

Using a dummy client tag change event script allows all of the normal advantages of bindings in the affected windows – particularly the continual updates and the option to still be bidirectional.

As for maintenance, it degrades gracefully if a few extra tags are used outside the list in the tag change event.

I appreciate it guys, I’m going to try go with pturmel’s suggestion, currently the dataset is built automatically I’ll let you guys know how it goes once I have time to put in the 3500 tags.

Any reason why you dont use a table component? Generate your dataset in script then push to a table? I do these types of data displays in tables all the time. Then when it comes to printing and exporting, etc. Things will be much simpler. Plus you dont have to fool with binding anything, everything just loads.

1 Like

diat150, That sounds good can you explain that a little better to me? Does the script load each data point into a dataset then the table just reads the dataset? After that you would have to re-calculate the dataset occasionally in order to re-fresh the data? I could definitely use the tables in a few different spots if I could get it to work well.

yeah, basically you just use a button on the screen or a timer component. Then build the dataset. push the dataset to a table component. You can also build a dataset to customize the headers or make them static. If I were you I would work on just trying to get a few of your flowrates in a table and work out from there. I store alot of info in database tables also to make it easy to query out what I need, like routes, devices, etc. The less manual integration you have to do the better.

Thats really the way to go. I do alot of oil and gas and I use table components almost exclusively to do everything.

Thanks, I have been using mySQL tables other places where I periodically store my data in the exact format I want it to display in tables for reports, but I was trying to limit the number of custom tables I produced.

Is there a way to dynamically generate a Client Tag Change script? Where I’m going with this, is that you could define a boolean client tag that could be set whenever any of your interesting tags are changed and your dataset build script could could be triggered by watching the client tag change. The dataset build script would also be responsible for setting the tags that will trigger the Client Tag Change script.

That is good for display of like tag data, do you also use this for updating tags from the table? Do you save the tag path in the table for outputting to? Or, how do you determine what tag to update for a given dataset cell?

yes, I save the tagpath in the table which allows me to use it whenever I need. I make use of popup windows to do things like write setpoints, or change tag values.

With your current configuration, do you see your memory usage going up and have the screen slow down if you switch between this screen and another or refresh this screen frequently.

I had a project that had a rather complicated set of templates that I displayed using a Template Canvas and I ended up reducing the size of the list from the 20 the client requested down to 10 because when switching to this window eventually the client froze because it ran out of memory. My forum post

Note that one of the things I had to do was adjust memory allocation to the JVM. If you haven’t done that you might wish to investigate appropriate values for the JVM heap.

We have noticed the memory usage spike at times but recently we hover at 25% and will spike to 30% when loading the template repeater page. We have gone and adjusted the memory allocation to the JVM to 4GB but we really don’t go over 1.5GB at any time.

I’m moving pretty much everything this direction and I was hoping with your experience you might be able to help me out on one or two topics.

For my some wells have oil datapoints while others don’t. I’d really prefer to display a blank if they do not exist instead of a value of 0. However, the dataset throws an error of different data types when I do this.

Alternatively I could force all the data[points to a string and then the blanks go into the dataset no problem, but when I go this rout anything over one thousand does not contain the commas because of the python formatting restrictions so when i display rates of 100,000 they show up as 100000 and not that readable to the operator. Is there anyway to fix either of these issues?

You could use the Java API’s DatasetBuilder, so you can explicitly set column types to java.lang.Object.