There is no way to control the order of the IOSP classes loaded by the ServiceLoader. This can result in very slow performance for S3 Zarr files, since many IOSPs will want to read the data to check if it is a valid file of their type. The ZarrIosp check is super fast since it only needs to check whether its Raf is a directory type.
I propose to add a new method to the IOServiceProvider interface that will sort the IOSPs into two (or later more) groups so that the fast/common IOSPs can be checked first and the rest checked later.
Description of Changes
There is no way to control the order of the IOSP classes loaded by the
ServiceLoader
. This can result in very slow performance for S3 Zarr files, since many IOSPs will want to read the data to check if it is a valid file of their type. TheZarrIosp
check is super fast since it only needs to check whether its Raf is a directory type.I propose to add a new method to the
IOServiceProvider
interface that will sort the IOSPs into two (or later more) groups so that the fast/common IOSPs can be checked first and the rest checked later.