Disabled (expensive) Format-rules vs performance

Do disabled (expensive) Format-rules still affect performance?

Is it better idea to delete them?

Solved Solved
1 19 638
  • UX
1 ACCEPTED SOLUTION

@Kirk_Masden โ€” very good guidance from you to treat โ€œrendering performanceโ€ or โ€œinteractive performanceโ€ in a different category from sync performance.

Rendering performance is really about what we ask the device/browser to do when a users taps on something or scrolls something. The processor on a device is slow and if you ask it to do a lot of computation, it will make the UI feel โ€œsluggishโ€ (takes a noticeable time for a UI response). Expensive format rules fall in this category, as do expensive searches, as you point out. Also, if you had a very large data set and open a view on it, it could be slow if all the data has to be processed in some way (still, the example you had of a view with 8000 records feels odd to me).

If a format rule is disabled, then it is not computed and therefore there is no impact on interactive performance. Now if your app had a thousand disabled format rules (for no good reason) then it will probably need more memory resources, the system would loop through the thousand rules, check each of them and decide they are not to be applied, etc. So some overhead for a pathological case like that but not in the normal cases.

View solution in original post

19 REPLIES 19

I wish someone had responded to this. I too am interested in this topic.

My workaround is to play-safe by removing them and save their expensive expressions for reference.

Format rule is surely slow donw the performance. I could not find my previous post reporting about this.

when the app is rendering HTML to generate app view, the app formula is evalulated to apply format rule such as color etc. This is just CSS stuffs, so it is affecting the rendering process. I confirmed with this AppSheet dev team before.

So best practise is not to push too much format rule to the view if we want to ensure the higher performance (rendreing view) on html.

@Takuya_Miyai

Thanks for the info.

However, this topic is โ€œ[Disabled (expensive) Format-rules vs performance]โ€.

Generally we all know that the expensive rules affect app performance. But what if we disable & keep them, would they still affect the app performance.

Ah, okey I got your point now, thanks.

Hi @Swoopy ! I found this:

Iโ€™m not sure if I have a complete understanding of what @Phil is explaining here but I guess one take away is that the difference between a format rule being disabled and being deleted would be negligible in terms of the time it takes to read the rule into the deviceโ€™s memory. I assume that also means that a disabled rule with an expensive expression would not cause a problem for performance but I would appreciate it if someone could confirm that.

Iโ€™d like to point out that there are two kinds of โ€œperformance.โ€ One has to do with sync times. This is what the โ€œPerformance Profilerโ€ helps us with:

The performance profile helps you understand and tune the performance of sync operations

But sync time is just one aspect of performance. As this comment from @praveen indicates, โ€œdisplay/renderingโ€ is another:

I think the distinction that @praveen is making between two kinds of performance (sync vs. rendering) is very important. However, my impression is that the two types are usually not distinguished in this community. Take this quote from @Adam:

Of course, @Adam is correct, but the kind of performance he is referring to is โ€œrenderingโ€ not โ€œsyncing.โ€

When an app performs sluggishly on a device, it can be hard to figure out what is slowing things down. I came to this post of yours today because an app of mine was very slow in table view. I could view it but resorting columns by tapping on the headings was very slow. I thought my format rules might be the problem so I disabled them but that didnโ€™t work.

What did work was @tsuji_koichi 's suggestion to reduce the number of columns that could be searched. (Thanks Koichi!) Another change I made that had a big impact was to delete an extra view that displayed the same 8,000 or so records. Fortunately, I didnโ€™t need that view (I just made it as a sort of test of another way of constructing the view). It was interesting to me, though, that deletion of one view could have a significant impact of rendering performance.

So, all of this is making me think that it would be nice if AppSheet could improve its performance tools by adding a โ€œrenderingโ€ category. Also, Iโ€™d like to suggest that discussions of performance in general distinguish between syncing performance and rendering performance. Iโ€™ve been getting some very useful help regarding performance from @MultiTech_Visions, @Marc_Dillon , @1minManager and @Steve recently. I wonder if they have any thoughts about how important / unimportant it is to distinguish between syncing performance and rendering performance.

Thanks.

Because we donโ€™t know the mechanism inside AppSheet engines.

Case#1: Disabled (expensive) rules are not loaded at all, they donโ€™t affect anything.

Case#2: Disabled (expensive) rules are always loaded into memory & just sitting in background, they wouldnโ€™t affect anything.

Case#3: Disabled (expensive) rules are always loaded into memory & processed in background, they may affect something.

I think that Philโ€™s comment means that they are loaded, so itโ€™s either Case #2 or #3.

My thoughts on this are that if as @praveen said they only affect rendereding then unless there is obvious rendering isses then just leave disabled. If it is causing issues then what I would do is to document then delete the 2-3 most intensive ones and see if that cures it.

@Kirk_Masden โ€” very good guidance from you to treat โ€œrendering performanceโ€ or โ€œinteractive performanceโ€ in a different category from sync performance.

Rendering performance is really about what we ask the device/browser to do when a users taps on something or scrolls something. The processor on a device is slow and if you ask it to do a lot of computation, it will make the UI feel โ€œsluggishโ€ (takes a noticeable time for a UI response). Expensive format rules fall in this category, as do expensive searches, as you point out. Also, if you had a very large data set and open a view on it, it could be slow if all the data has to be processed in some way (still, the example you had of a view with 8000 records feels odd to me).

If a format rule is disabled, then it is not computed and therefore there is no impact on interactive performance. Now if your app had a thousand disabled format rules (for no good reason) then it will probably need more memory resources, the system would loop through the thousand rules, check each of them and decide they are not to be applied, etc. So some overhead for a pathological case like that but not in the normal cases.

Thank you very much, @praveen and @1minManager ! Iโ€™m starting to think that my Android device might be the problem. With 8,000 records, my app works quite nicely on iPhones (even an old iPhone 6) but can be sluggish on my LG X5 (2018), which doesnโ€™t have very high performance ratings:

Iโ€™d like to ask one last question regarding rendering vs. sync performance. Iโ€™ve learned to be wary of virtual columns. I know, for example, that virtual columns with expensive expressions (e.g. SELECT(), etc.) can be problematic. I wonder, though, about how best to handle simple text onto which I hang inline actions, such as hyperlinks. To improve performance, Iโ€™m currently converting a number of hyperlink virtual columns, in which each line constructs a different URL based on the word in that row, to actions in which the URL constructing expression is in the action itself, not in a virtual column. Itโ€™s my understanding that this will be better from a performance point of view (syncing and rendering?). The question I have now is Can I use virtual columns for the text onto which I hang those inline actions? The text is extremely simple โ€“ something like =โ€œLongman Dictionary of Contemporary Englishโ€ and repeated, without variation, 8,000 times. Of course, itโ€™s quite easy to put a consistent line of text like this in a real column, but I wonder if it really is a good idea to fill my sheet up with such real columns that each have 8,000 copies. If getting rid of the virtual columns in this way is a good idea, I wonder if I will be doing it primarily to improve sync performance or if it will have an effect on rendering performance. Thanks!

This is very clear explanation.

Thanks BOSS.

Hi @Kirk_Masden, you should never have a virtual column that is just a constant. That will just bloat your data with 8000 copies of that text.
Iโ€™d suggest you just put that text into the place you want to use it (inside the action constructing the URL)

In some case I myself decide to use this practice as workaround (have a virtual column that is just a constant/or another copy of related column such as [Columnโ€™s name] in the virtual columnโ€™s expression). The reasons is just to change the columnโ€™s display names on table views (normally make it shorter than in the detail/form views).

You would suggest using CONTEXT() to control the display names of the real-columns (not having the virtual columns). This is okay if there is no in-line action bound to it because if there are in-line actions bound to the real-columns, they are shown on related table views and cannot be hidden.

Iโ€™m not sure if this problem is solved yet. I used this practice a long time ago.

Related topic

Thanks again, @praveen ! Iโ€™m sorry to bother you but Iโ€™m still confused. Iโ€™m using inline actions for my URLs:

Earlier, these actions began as virtual columns but after getting some expert advice I was convinced that I needed to take the URL constructing expressions out of the virtual columns and put them in actions.

(Note: Thereโ€™s an interesting comment from @MultiTech_Visions immediately after Steveโ€™s comment about AppSheet sample apps not following best practices. If you havenโ€™t seen it, you might want to ready it.)

So far, so good. The problem is that I think I need a column to attach the action to. So, I thought my only choice was between either virtual or real columns. Is there a third approach? If not, should I go with real columns?

P.S. Hereโ€™s what the links look like in my app:

Each link looks up the key term (โ€œcurateโ€ in this case) in the named dictionary.

Currently, the โ€œEnglish Japanese dictionariesโ€ heading (and headings for other categories) are virtual columns. Perhaps I need to make these real columns.

Hi @Kirk_Masden , ok I understand. Your question really isnโ€™t aything to do with actions, I think.

You need some column to attach inline actions to. So you are creating some virtual columns just so that there are appropriate attach points.

I suppose if you really want a lot of inline actions, then that is what you need to do. Whether those are virtual columns or physical columns, it doesnโ€™t really matter. If the same constant values are being repeated 8000 times, it is a waste of memory, network bandwidth, and also a bit of virtual column computation (even tho it is just constant expressions).

We do have the concept of โ€œShow typeโ€ columns that are just for presentation but not actually in each data row. Thatโ€™s what you normally use for section headers, etc. I donโ€™t think we currently let you attach actions to them (this is the first time Iโ€™ve seen a possible case for it). Have to think more about it

Thank you very much for your response. Now I understand what I need to do to finish my app.

I took another look at the โ€œShow typeโ€ column. It has a useful URL category that works well. Unfortunately, as you indicated, I canโ€™t attach actions to such a column. Also, the appearance is somewhat different from an ordinary column (the text is turned blue as in HTML, line spacing is different, etc.).

For now, I think I can depend on the processing power of most devices to overcome certain inefficiencies that will remain in my app. If, however, a day comes when we can click on a button and make virtual columns โ€œShow onlyโ€ (cannot be referred to in expressions, etc) I think that would make the AppSheet platform that much more powerful. Or, the current โ€œShowโ€ type could be expanded but, if that happens, I hope the column will be visually indistinguishable from ordinary virtual columns.

As always, I appreciate your taking the time to consider my rather unconventional uses of AppSheet.

Another use case: Instead of showing the Action, use a Show Type VC and attach the Action to it.
This is possible with Text Column type, but not with Show column type.

3X_7_4_74bb5c80756c6727819dc33ab94b613aeb1982c8.png

Top Labels in this Space