Newbies esdummit Posted September 11, 2004 Newbies Posted September 11, 2004 I just received FMD7, installed it on my home mac G4 400 mhz, and started toying with files developed in FMP5. Complex multiloop scripts which took 10-15 seconds in FMP5 are taking 5-15 minutes in FMD7! these scripts ran beautifully in FMP5 in classic mode and on Windows 2kPro and NT. On my mac in 10.2.8 they are interminably slow. Is it that I need a new mac (god forbid!)? Or is there a way to fix this? Why would it run SO MUCH FASTER in classic and FMP5? I thought upgrading to an OS X native app should speed things up, not slow them down! I have not yet tried it on the office W2k machine, as I am waiting for the beaurocracy to approve the installation. The file is designed to plot height and weight percentile curves for children, based on the latest dataset from the CDC. It works well and is debugged for FMP5, but I would like to move up to 7 for the advantages it offers. I am gathering a variable from 7 fields of 100-600 records to plot in a graph: Set Field [ Plotter::gXseries; "" ] Refresh Window Go to Record/Request/Page [ First ] Loop Set Field [ Plotter::gXseries; Plotter::gXseries & GetAsNumber(Plotter::Agemos) & " " ] Go to Record/Request/Page [ Next; Exit after last ] End Loop Set Field [ Plotter::gXseries; Left(Plotter::gXseries; Length(Plotter::gXseries) - 1) & "; " ] Set Field [ Plotter::gFunctions; Plotter::gFunctions & "
Fenton Posted September 11, 2004 Posted September 11, 2004 Well, I had an eMac 700 MHz. FileMaker 7 ran OK, but was a little slow. So was 10.2.8. I soon got a eMac 1.25 MHz, with 10.3.4. Much better. I'm saving up for bigger and better things. 400 MHz is basically obsolete. You will not be happy with it.
transpower Posted September 11, 2004 Posted September 11, 2004 I don't understand what your code is doing ... but why go through all those loops? If you could use other variables you could just go through the records once. That would drastically speed up this script.
bruceR Posted September 12, 2004 Posted September 12, 2004 And if you merely converted the files, there may be a lot of other issues - file references, etc. It could also be sped up considerably with applescript; no loops required. If you copy a field in applescript you are copying an entire column. For instance something like this: copy field Plotter::P90 to temp -- now we have the entire column set applescript's text item delimiters to " " set field Plotter::gFunctions to (Plotter::gFunctions & ";" & (temp as text) )
Newbies esdummit Posted September 12, 2004 Author Newbies Posted September 12, 2004 Thanks for feedback. Transpower's idea for using "other variables" might work, but BruceR's thoughts about applescripting probably would not, since I need to keep the file cross-platform compatible, as I shall be deploying it on a windows network at work. Perhaps creating a set of global variables to store the concatenated data series would speed things up considerably. Nonetheless, my concern is only partly about this file. It also has to do with the speed issue. Perhaps it has something to do with the changed nature of the scripting functions, although all of the scripts appear to have converted to v7 without a problem. Friday night I ran a little comparison on my "obsolete" G4-400. Using the script that has the above set of loops, processing 481 records, these are the results: Script took 14 seconds in FMP5 and Classic mode. Script took 678 seconds in FMD7 and OS 10.2.8. 678/14 = 48.4 Graphicly: Classic & FMP5.....XX OS X & FMD7........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.x Longer bars are definitely not better in this benchmark. Why would classic and FMP5 be nearly 50 times faster?! I would think that v7, fully carbonized and native to OS X, should at least be equal in speed, if not faster. It should be basicly the same number of operations, or are FM7 and OS X bloated with 50 times as much code to achieve the same result? I have seen other posts griping about the speed of various operations in v7, so I am guessing that the FMI programmers have not really sorted out and optimized the code in FM7 for speed. Must be they are hoping we will all buy G5's instead of expecting the software to perform on our current equipment. You can save up, Fenton, but I already have a substantial investment in my G4's, which perform just fine for everything else I do, and I cannot afford a new machine now. Besides, my wife would probably kick me out of the house if I replaced my computers before her old clamshell iBook SE!
bruceR Posted September 13, 2004 Posted September 13, 2004 "Nonetheless, my concern is only partly about this file. It also has to do with the speed issue." But the speed issue is a direct result of the file issue and is not inherent to FM7. It does not look like you have answered any of the conversion questions.
Vaughan Posted September 13, 2004 Posted September 13, 2004 I'd suggest doing all the Set Fields in one loop through the records. Doing multiple passes is nuts, even if it was fast in FMP 5. I'd also consider explicitly Opening the record before processing, then Committing it before moving to the next record. As a test, include the Open and Commit steps in the script as it is and see if it makes a difference. Then try doing all the work in one pass and compare.
Newbies esdummit Posted September 14, 2004 Author Newbies Posted September 14, 2004 Bruce, according to the script debugger and a lot of head scratching, all the scripts relevant to the above problem converted without a problem. Vaughan, the design of the loops has to do with the requirements of the xmChart plug-in and the way it processes commands and data. It could be done in a single loop, by creating seven gVariables to hold the seven series of P5 through P95, then concatenating them at the end of the script to create the long string of data points, but it would still be slower in FM7. A single loop of the script in FMD7 appears to take around a minute to two, depending on the number of records. A single loop in FM5 takes less than 2 seconds. I shall look into the issue of Open and Commit, as I am still learning the v7 commands. I used Transpower's suggestion of creating other variables to speed up part of the process. The file takes a group of records from the CDC.gov/growthcharts/ dataset to create a background chart of 5th to 95th percentile curves upon which a set of datapoints for measurements of a particular child can be plotted. I have designed 14 charts to match girls' and boys' height, weight, body mass index, head circumference, etc. for different age ranges. Since the background data do not change, it makes sense to put the data into a set of 26 global variables, for the various age X-axis datasets and measurement Y-axis data, that can be called without running through the loops above. I did this in FM5, and it did speed up the chart redrawing process. What took 14 seconds now takes three. I have not yet had a chance to test it in FMD7 (it's on my windows machine at work, and I am still waiting for the IS guys to install FMD7). But if the above relationship of 48x more time to process is true, then I will still be dealing with 2.5 minutes to plot a chart that takes 3 seconds in FM5. To gather the data from an individual child's records will still require the tedious loops to convert columnar data to rows for the chart plug-in, but that should only be a handful of records compared to the background curve data; seconds, not minutes. I shall keep you all updated as I proceed. Thanks for feedback. It definitely helps me to rethink the process.
Recommended Posts
This topic is 7374 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