fix perf regression in 5f65f568e6e6de92b3d514eec76d14971c9326a7