Contents

suggestedBatchSize

The batch size that the system recommends.

Declaration

optional var suggestedBatchSize: Int { get }

Discussion

The system suggests the batch size to optimize performance based on the context of the pending changes. The system can request the enumeration of a container for various reasons, such as if the user has the directory open in Finder, or the file open in an application. Each case has its own performance profile.

If the enumerator has more pending changes than the suggested batch size, it should split the changes into batches that are equal to or smaller than the batch size. If the enumerator has fewer changes than the suggested batch size, return all the changes immediately and finish the enumeration. You don’t need to wait for more incoming changes.

While using the suggested batch size helps ensure the best user experience, the system enforces a maximum of 100 times the suggested size.

See Also

Observing Changes