Disabled Format Rule or Workflow

I suppose that every Format Rule and Workflow makes the App bigger and bigger. I mean the JSON file, that’s behind the App.
So when I disable a Format Rule or Workflow - will it be saved anyway in the JSON App file, or just in the App Editor?
I mean - would it lighten up the App to not just disable Format Rules and Workflows, but delete them?

In my experience, simply disabling any costly element has the effect of removing that slowdown.

For example: I had a workflow that captured edits made to a column (I was just posting about this) to create a history of changes to a column. The problem I ran into is that the formula
[_thisrow_before].[Column] <> [_thisrow_after].[Column] is really costly when running on a table with thousands of records.

I didn’t want to delete it, but disabling it DID remove the major slow down it was causing.

3 Likes

Hi Fabian,

The entire app is contained in the AppTemplate. The AppTemplate contains everything about the app other than the workflow templates that are stored externally. The AppTemplate includes disabled Format Rules or Workflow Rules.

The Editor simple displays and updates the AppTemplate. When you launch the Editor, it loads the AppTemplate. When you save the app in the Editor, it save the AppTemplate. The Editor has no “state” of its own. All “state” is in the AppTemplate.

The client also downloads the AppTemplate when you run the app on a device.

The size of a Format Rule or Workflow Rule in the AppTemplate is relatively small. I would be surprised if deleting them would have much effect.

We must check whether a Workflow Rule is disabled but this is relatively cheap.

3 Likes

Thank you @Phil for that detailed description. I very much appreciate it.

1 Like

Hi @Phil!

I wonder about the warnings AppSheet shows me about possibly “expensive” format rules. If disabling them removes the worry about the expense, shouldn’t the warning for that particular rule go away too? I just tried it and my warnings were unaffected by the disabling.

By the way, here’s an example how the performance analyzer is warning me.

I didn’t notice any change, even when I disabled quite a few of the format rules.

I’ll experiment with disabling format rules and watching to see changes in performance. In the meantime, I hope that AppSheet can adjust the warning messages to reflect the relatively “inexpensive” cost of disabled format rules.

Hi @Phil! Here are the preliminary results of my performance profile test, with various format rules collectively enabled and all disabled:

Operation: Edit row; On: Kankaku
Enabled average: 1.534651163
Disabled average: 1.941494949

Operation: App sync
Enabled average: 14.94411111
Disabled average: 15.90344444

This, of course, is quite surprising. I expect disabling to increase the speed, not decrease it.

@Fabian, I wonder what you think of this. It would seem that it may be necessary to delete the format rules, though I haven’t tried that yet to see how much that improves my sync speeds. The problem for me is that I made the rules for a reason and so I hesitate to just throw them out without knowing how much improvement I can expect.

Oops! Looks like I should have waited for more data to accumulate. My current “enabled” average “Edit row” is now 2.637794393 and the sync average is now 20.72654902. I guess sample size is important in making a definitive assessment. I’ll keep collecting data and report back later.

On the other hand, big swings in average sync times like this make me wonder what other factors may be involved. The range in the amount of time it takes for an edit to a table can range from less than a second to over 10 seconds. It’s hard to make sense of the data with all of this variety in sync times.

I hope I can be forgiven for continuing to post in this thread. I’m trying to figure out how to make sense of the performance details I can access:

This image is for an operation that normally only takes a second or two: writing to a table. I can understand that, for some reason, the operation took much longer than normal, but I have no idea what might have occurred.

This, by the way, happened when the format rules were enabled, but I have no idea whether or not the format rules had anything to do with the slow sync.