+1 to catching the added space being a great catch/good eye.
When I saw that post, one of the first concerns that I had was:
How many times is the custom function being called, and how many total extra chars are being added to the data being set in the fields?
I did my best to grok the script to get a sense of this, but I could not, so I decided to run a test, using a variation of the script.
The script variation was as follows:
- Define some extra variables in the script to capture some metrics:
- In each place where the script would have set a field (regardless of by name or not), comment out the setting of the field action, and instead, add a line that captures some metrics about the size of the data that would have been set in the field:
This is what the calculation looked like that was used to capture stats:
- Periodically display stats so that I could observe any obvious trends:
Having set up the above, I grabbed the following stats upon running the script:
- After processing 10K records:
- After processing 20K records:
- After processing 30K records:
- The final batch of stats:
Comments:
The first thing I’d like to say is that it would be great if someone could check my work for sanity.
My FMP skills are rather rusty these days, and I don’t doubt that I could have slipped up somewhere in my methodology. Additional sets of eyes and brain cells would be good to have before we accept what I’ve posted above.
If the methodology and stats do seem accurate, then I think an important aspect of this thread that I did not see mentioned, is that there is a rather non-trivial amount of extra data that the original script tries to set into the records (versus a script which first scrubs that data by use of GetAsNumber, or anything else that will remove the added space chars).
I’m deliberately staying away from passing judgement or making comments about what the behavior should be when one tries to store long string values into a FMP number field. My intent is simply to bring awareness to what I am observing, which is that this does not appear to be a matter of a small number extra space characters causing the slowdown. Barring an error on how I set up the metrics (and again, I hope someone will check my work), it appears as though a very non-trivial number of unwanted characters are being handled by the script.
I hope that this helps in some way – either in better understanding of the nature of the symptoms observed, or any other way.
Kind regards & HTH,
-steve
I’ll attach a zip of the file as I modified it.
FMPA Type Conversion Isssue_MOD.fmp12.zip (525.2 KB)