[performances] Minor optimization

(cherry picked from commit b2fcae807986846c7a102652da5badf1b97fbf6e)