Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script Efficiencies

Featured Replies

I recently tested a few script methods for speed and thought I'd share what I saw.

 

I have a FMP project that constructs a ternary tree database. I set up a design and ran it under varying circumstances in order to determine my best practices for this project. I am learning FMP and would like to know these things for all my projects.

 

As a baseline I ran 2000 nodes of a single design. I looked at 3 main script parts. Times are in milliseconds

 

No filter, no find,  no print 1569, 1611, 1580

No filter, no find, with print 5446, 5512, 5473

 

about 4 seconds to print 2000 records 1x1.

 

No filter, with find, with print 31970, 31940, 31936

 

That scripted find is a monster.

 

Let's try to filter things. The data has to pass 2 tests. Filter A is a single if with 2 conditions in it and filter B is 2 nested if's for the same tests.

 

With filter A, with find, with print 31616, 31609, 31638
With filter B, with find, with print 31648, 31680, 31667
 
It's a bit faster to use a single IF with logical AND for the 2 tests.
 
And I wonder what the overhead for a frozen screen refresh is
 
0 Refresh 31648, 31676, 31667
1 Refresh 32607, 31895, 31862
 
Insignificant for my project. I can refresh as much as I'd like.
 
Next I want to examine that scripted find and see what happens as the number of records increases. I'm also looking for a way to get field validation to return a boolean so I can see if that's any faster.
 
Another avenue to look at is to print all the records and post-process duplicate removal. Maybe that's faster than using a scripted find.

 

Rather than timing the whole script and comparing times when enabling and disabling different parts of the script, I've found it to be more helpful to time the different sections of the script separately. That way, I can see which part of the script is relatively slow with one test run total instead of one test run for each section under consideration.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.