|Home > Generic function call interface > Function call optimizations > Fast argument parsing using sorted arguments|
The Iris function call mechanism passes function arguments by name. It also passes object members, for example members of passed or returned structs, by name.
Therefore, it is possible for the caller to order arguments or members differently in each call. If so, the callee must repeatedly search the list of arguments or members. This has a large performance impact, particularly because functions might accumulate many optional arguments over time.
To avoid this problem, the caller should list the arguments for a function in alphabetically ascending order and the callee should parse the arguments in this order. If the caller and callee follow this rule then the argument list only needs to be parsed once. This does not impose any overhead on the caller. However, the callee cannot always rely on a sorted argument list because this rule is not compulsory. The callee must support unsorted or incorrectly sorted lists.