optimized for sets smaller or equal to batch size