gaia algorithm performance optimize.