1.

How To Reduce Function Call Overhead In Arm Based Systems

Answer»
  •  TRY to ensure that small functions TAKE four or fewer arguments. These will not use the stack for argument passing. It will copy into registers.
  •  If a function needs more than four arguments, try to ensure that it does a SIGNIFICANT amount of work, so that the cost of passing the stacked arguments is outweighed.
  •  Pass pointers to structures instead of passing the structure itself.
  •  Put related arguments in a structure, and pass a pointer to the structure to functions. This will reduce the number of parameters and increase readability.
  •  Minimize the number of long long parameters, as these take two argument words. This also applies to doubles if software floating-point is enabled.
  •  Avoid functions with a parameter that is passed PARTIALLY in a register and partially on the stack (split-argument). This is not handled efficiently by the CURRENT compilers: all register arguments are pushed on the stack.
  •  Avoid functions with a variable number of parameters. Varargs functions.



Discussion

No Comment Found