IBM Support

Performance tip

General Page

You are in: RPG Cafe > Performance tip

Short URL: https://ibm.biz/rpgcafe_perf_tip

RPG Cafe: Performance tip

Performance tip

Here is the tip: Beware of performance tips

For me, the performance rule that never changes is this one: Always question any rule you hear about X performing badly, or Y performing better than Z.

  • Was it ever true?
  • Is it still true?
  • Might it change in the future?
  • Can I measure the difference?
  • Does it apply to my current situation?
  • Does the difference matter enough to code in a more complex or error-prone way?

The trouble with performance rules is that even when they are valid rules, people tend to remember them too long. This can cause people to cling to what has become a poorer-performing way of coding, or cause them to code in unnecessarily awkward ways.

Here are some commonly held "rules" to question

  • SETLL + READ performs better than CHAIN
  • SQL is slower than RPG
  • SQL is faster than RPG
  • Using VARLEN fields in database slows down the file
  • Subroutine calls are faster than subprocedure calls
  • Packed variables perform better when they have an odd number of digits
  • Flying is faster than taking a train

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"Component":"ILE RPG Compiler","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
16 December 2019

UID

ibm11119393