bcooney Posted April 3, 2008 Posted April 3, 2008 I've heard several best practice techniques for optimizing a looping script: 1. Loop through found sets in form view (not list). 2. Loop on a blank layout. 3. Avoid refreshes, try to freeze window. 4. Go to a field first. Any others? Obviously, I'm trying to optimize a report script that's taking 4 mins. It loops thru parents, children and grandchildren so there are several gtrr, setting variables, global fields and creating new records in a report table. Would creating a layout with a portal avoid gtrr and speed up the process (perhaps, because the gtrr is forcing a refresh of some sort?).
fabriceN Posted April 3, 2008 Posted April 3, 2008 (edited) I was going to suggest precisely this Look at Todd Geist's transactional technique, I find it really speeds up these loops, which is another positive side effect ! Edited April 3, 2008 by Guest
bcooney Posted April 3, 2008 Author Posted April 3, 2008 (edited) Thanks. I will look. I believe he wrote about this model in FM Advisor, and I'm sure I have the issue. Thanks. here's a link to Todd's article. Transactions in FileMaker Edited April 3, 2008 by Guest
fabriceN Posted April 4, 2008 Posted April 4, 2008 I'd say his blog is a must. http://www.geistinteractive.com/
bcooney Posted April 13, 2008 Author Posted April 13, 2008 Fabrice, Using portals (with allow create on) to create the child records, rather than grabbing keys in variables and switching layouts/new record took the report from 6 mins to 1 minute! Wow! ...still optimizing.
Recommended Posts
This topic is 6069 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now