Need for Speed in Displaying Forms & Opening Windows

Asking for any speed tips people have gleaned while working with Pan X vs. Pan 6. I’m finding even clicking to open a small dialog form to take about 4 seconds now where it was virtually instantaneous in Pan 6. Closing said dialog by clicking the Cancel button with the single command “CloseWindow” takes 3-4 seconds. Rendering the Calendar and Patient Account windows take from 4 to 6 seconds each - or more. Most of the time is spent in the background selecting records or building arrays, but forms display very fast once they pop into view, even with complex text displays (see clips below).

There is no noticeable difference with a new M1 iMac vs my old 27" iMac. It almost seems like the program is thinking for a bit before executing commands.

CooperT mentioned in the post “Changing Text and Field Color Erratic” 10 days ago that he significantly sped up a mocked up Calendar similar to mine by using Dictionaries and eliminating Rich Text. I will explore that with him off line.

After much experimentation with different arrangements of Matrices, Text Displays, creating arrays in procedures vs in the form, I still can’t get forms to open and display quickly. I make sure every DB is secret and only the one form I want is open, which helped prevent background updating of open windows. Eliminating unnecessary “Save” commands strategically placed in procedures speeds things up, I’ve found. Mostly I’m using the old basic commands I’ve picked up over almost 3 decades of Pan programming, so there might be new things I’m missing.

I know this is very general and vague, but asking for any tips or avenues to explore.

Scott

A clip of an account display and Calendar:

Screen Shot 2022-01-29 at 11.14.33 AM

The times you describe for opening a dialog seem unusually long.

A couple of other comments on speed, based on my experience.
I have not used matrices in a long time, since the early days of PanX 10.1. I found that there were very slow when handling a modest amount of data. Text Lists are much faster. I don’t know if this is true today, but I have not found any situation where I need the additional formatting abilities of matrices compared to Text List.
Some reports that I use will synchronize before generating the report, a slow but necessary step in some situations. (Possibly one could display the form then sync then recalculate the form to make it appear faster.)

Someone referred to (was it Scott) displaying forms that required large number of lookups. That will take time and there could be ways to avoid that. In one large database I have (70,000+ records), I avoided lookups by performing the lookup when a row is added and saving the data there. That is, each record had a matter number and there is a corresponding matter name in another database. One could look up and store the matter name in the first database, and not look up the name each time you use the matter number is a report/display. This approach moves the lookup so they happen on a distributed basis, when records are added, and not all done when a report is generated.
Anything that redraws the screen takes time and should be avoided, which you already noted you were doing.
I suggested in another topic not using rich text display in Text Lists, not for speed reasons, but that might be a reason also not to use it.

I did just find one place I sped up opening a dialog box - I used to have save and saveall in procedures any time major steps were taken. That now seems to halt the action until complete and with my Fusion Drive that can take a couple of seconds. When I removed that in one place, the speed went from 3 to 1 second to open a dialog. But there are still key places where that isn’t at play that could use extra speed.

I will play with the dictionary concept Tom mentioned to see if keeping the calendar data in one place will speed up jumping from week to week.