Also locally cache length in BaseDataSource and use zero cost castNonNull to make sure there's no performance regression. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=207715734