Cherry pick performance improvement for cirrus

Change-Id: I705ec04e43d4cee77e8d52f486c590fc81b50076