You can use G2's profiling system procedures to gather information about your KB's execution. After identifying which portions of your KB can benefit from further optimization, you can apply compilation configurations to the appropriate definition items and executable items, so that G2 compiles the statements and actions in those items more efficiently.