g2: add optimization

Change-Id: I9f250a7a3c9e8a4be642ee8f0afacb36268edd41
Signed-off-by: houst0nn <houstonn@gmail.com>