Memoize show_lengths as well.