I shared this issue with the team.
The listing is slow because the prefixes are part of the object name, so they are encrypted too by default. And to list them either your libuplink (when you use a Storj native integration) or libuplink on the Gateway-MT (when you use an S3-compatible integration) will decrypt paths for every single object before return the list. This is impossible to cache, otherwise your information could be compromised (it would live unencrypted in the cache).
The distributed and encrypted nature of Storj is applying an overhead to usual listing operations, especially when you use unterminated prefixes.
I.e. if you would use a prefix like uplink ls sj://data/prefix
vs uplink ls sj://data/prefix/
the last one will be significantly faster, due to the same problem - prefixes are encrypted because they are part of the object name - it’s an object’s key. Unterminated prefixes triggers an exhaustive listing, because you cannot know before decryption where it will end unlike the terminated prefixes, even in encrypted form they would have a delimiter and listing will be faster, because it may be grouped by encrypted prefix with a delimiter.
E.g.:
$ uplink ls --encrypted sj://test
KIND CREATED SIZE KEY
PRE AgUC-F7GG6SoFWbjinkrarA224lJ0YusREDFkLcaCKjTFSEOBHU=/
PRE Agiz0yDTBh9ws6h8AQESJjppyhPAcpqiMTDQM-L0rmyq4ZZ-wTRaGUVXQdlgvqF-/
OBJ 2024-02-17 09:52:50 192 AgxzNWNKoTYDoL5Qs6pO_HX24rL-ArCC1e471hEpqZ7U0UXhr9ylTVsofAyTlfhtM55etjXIBJagWWQ=
So as you can see, the prefix with a delimiter (/
) has a representation even in encrypted form of Agiz0yDTBh9ws6h8AQESJjppyhPAcpqiMTDQM-L0rmyq4ZZ-wTRaGUVXQdlgvqF-/
To speedup a listing process you may disable the paths encryption.
If you do not want to have encrypted paths (and to get a more s3-compatible listing behavior), then you may create an access grant with support of unencrypted paths:
uplink access create --unencrypted-object-keys --import-as unencrypted-paths
this will create a root access grant with a name “unencrypted-paths” using the API key, satellite address and provided encryption phrase.
To generate a derived access grant to use it in rclone, FileZilla, etc. with a native Storj integration:
uplink access restrict --readonly=false --access unencrypted-paths
it will print an access grant which wouldn’t encrypt/decrypt paths (the objects itself will remain encrypted anyway).
Then you may use this access grant to configure rclone or generate an S3 credentials:
uplink access register unencrypted-paths
this will print S3 credentials with the permissions of the used access grant, including do not encrypt/decrypt paths.
Please note, access grants with enabled paths encryption and with disabled paths encryption are mutually exclusive, you would get a digital noise using the access grant with an unencrypted paths on buckets/prefixes with the encrypted paths and vice versa.
Please also try to use a terminated prefixes where is possible.