Be wary of dot notation with object access paths
As a performance best practice, Guidewire recommends that you be aware of the performance impact of dot notation to access instance arrays on object access paths. You can write an object access path quickly, but your code at runtime can run extremely slowly.
The following sample Gosu code suffers a performance problem. It acquires an array of interest types for all additional interests for all vehicles on the Personal Auto line of business.
var personalAutoLine : PersonalAutoLine
var personalAutoAddresses = personalAutoLine.Vehicles*.AdditionalInterests*.AdditionalInterestType
Most likely this was not what the developer intended. Determine the most efficient means of acquiring just the data that you need. For example, rewrite the preceding example to use a query builder expression that fetches a more focused set of interest types from the application database.
See also
