Does writing all the code in each field, or writing a document-level function and writing it, change the overall processing speed of the document?
Does (1) and (2) below change the overall document processing speed? For example, suppose there are about 20 fields that use the same calculation. And suppose it's a bit longer code.
(1) Write the same code in all fields.
(2) Write a document level function and use it.
Obviously, (2) is the safest and easiest way to write code.
"I've heard that generally global functions use a lot of memory, so it's better not to use too much."
Where have you heard or read this?
I don't believe there's any difference at all in memory consumption, and of course not in "safety", whatever that means.
It's much better to use a doc-level script with a function that is called from the individual fields because if you need to edit the code you can just do it once and don't need to go field by field to edit it.
Thank you very much. I was relieved to hear it.
Copy link to clipboard
I believe you read that uses of the "Global" object should be limited, because it can cause memory usage issues. This has nothing to do with functions.
Thank you very much. Your explanation was all I wanted to know. I learned a lot.