IDK how many steps are in your script, but here's my standard way to keep an eye on speed:
I have a table called SpeedTests with the following fields:
TestName - this is usually script name Plus step in script. I.e. DataImport_Step1
TestTime
Avg_s - this is an average of TestTime
Notes - this is rarely used, but in your case could be very useful. You could (for example) add a count of found records here if you think that might be part of the problem. Or add a username to this. You could then ask a tech savvy your team to send you a screenshot whenever they get a beachball, and you'll see the clock on their screen and can cross-reference the speed logs, and see what's different.
ApplicationVersion - this is to see if (for example) staff having problems are using an old version of Filemaker, or in some cases a newer version. I've definitely had cases where the older version is faster.
Then I have a script called SpeedTest_RecordTime_JSON which looks like this
# "TestName=Startup;TestTime="&Get(CurrentTimeUTCMilliseconds)-$StartTime
# JSONSetElement (
""
; ["TestTime" ; GetAsText ( Get(CurrentTimeUTCMilliseconds)-$StartTime ) ; JSONString]
; ["Notes" ; $Notes ; JSONString]
; ["TestName" ; "Optimize 2024 Detail" ; JSONString]
)
Set Variable [ $error ; Value: JSON_Create_Variables ( Get(ScriptParameter) ; "" ) ]
Set Variable [ $TestTime ; Value: GetAsTime ( $TestTime ) ]
New Window [ Style: Document ; Using layout: “⏱️SpeedTests” (⏱️SpeedTests) ]
New Record/Request
Set Field [ ⏱️SpeedTests::TestName ; $TestName ]
Set Field [ ⏱️SpeedTests::TestTime ; $TestTime ]
Set Field [ ⏱️SpeedTests::Notes ; $Notes ]
Enter Find Mode [ Pause: Off ]
Set Field [ ⏱️SpeedTests::TestName ; $testName ]
Perform Find []
Sort Records [ Restore ; With dialog: Off ]
Go to Record/Request/Page [ First ]
Then in any scripts I'm dealing with I grab the time in a few places:
When in Debug mode I then have a link on the home page which lets me see the results:
The other thing I do is test to see if there's anything on the screen that's causing a problems.
I have a button hidden so only people with $$DebugMode set can see it.
I duplicate the layout and then click on the button. The button finds a predetermined subset of records (in this case "currently active students") and then goes to record 100, and then goes to next record 10 times, refreshing the window and committing records in between and logs the time it takes to do this using the script above.
I then remove half of whatever is on the screen and run it again and see what changes.
Usually, if a screen is slow to load I can quickly find 1-3 fields on my screen which make up about 30-50% of my load time and I can find a way to fix that. Often I'll run an overnight script which manually caches joined data, or calculations or summaries.
Another thing I've done in the past, although I don't have the code handy for it, is I set up a ping test for users and I basically created my own speed test for the user, and I recorded that with the speed log. I was having a problem with one particular school I worked with with a horrible IT guy who throttled each Wifi hotspot to 40Mbs, so when all the students got onto their Chromebooks the teachers were seeing something like 2Mbps and they were complaining about beachballs. The problem only went away when the IT director finally got fired and the new person listened to me and fixed the configuration of the WiFi hotspots. There was literally NOTHING I could do about it on the Filemaker side, but the ping tests helped me document when the problem was happening.