calculate Cpp some optimized changes