Reduce on-the-fly length calculation