Automatically detect optimal block size.