(HI-239) Cherry pick speedup from master (from #22142)