Performance profiling FileMaker scripts
ExpertIdentify slow script steps using timestamps, the Data Viewer, and the Script Debugger to find and fix performance bottlenecks in production scripts.
What you'll learn
- How to add timing checkpoints to a script with Get(CurrentTimestamp)
- How to identify slow steps using the Script Debugger's step-by-step mode
- How to log profiling data to a table for analysis
- Common performance patterns: unindexed finds, large portals, unstored calculations
- How to use ExecuteSQL for read-only aggregation instead of looping scripts
A FileMaker script that runs in 0.3 seconds in development may run in 30 seconds in production against 100,000 records over a WAN connection. Profiling means instrumenting your scripts with timing checkpoints, isolating slow steps, and measuring the effect of changes. The tools available are the Script Debugger, the Data Viewer, and manual timestamp logging.
Add timing checkpoints to a script
Wrap suspect sections with timestamp captures. Compute the elapsed time in milliseconds using Get(CurrentTimestamp) at the start and end of each section. Log the results so you can compare runs.
# Script: Profile - Batch Update Set Variable [ $t0 ; Value: Get ( CurrentTimestamp ) ] # Section 1: Find records Enter Find Mode [ Pause: Off ] Set Field [ Products::Category ; $category ] Perform Find [ ] Set Variable [ $t1 ; Value: Get ( CurrentTimestamp ) ] Set Variable [ $findMs ; Value: ( $t1 - $t0 ) * 1000 ] # Section 2: Loop and update Go to Record/Request/Page [ First ] Loop Set Field [ Products::UpdatedAt ; Get ( CurrentTimestamp ) ] Commit Records/Requests [ No dialog: On ] Go to Record/Request/Page [ Next ; Exit after last ] End Loop Set Variable [ $t2 ; Value: Get ( CurrentTimestamp ) ] Set Variable [ $loopMs ; Value: ( $t2 - $t1 ) * 1000 ] Show Custom Dialog [ "Find: " & $findMs & "ms | Loop: " & $loopMs & "ms | Records: " & Get ( FoundCount ) ]
Sign in to track your progress and pick up where you left off.
Sign in to FM Dojo