Stats in cs3 also provide all extended attributes of a file in the form of arbitrary_metadata properties. As xattrs are extensively used throughout the code and currently cost an additional, redundant Stat call, an easy optimization is to cache the results and make getxattr calls just a cache lookup.
The only caveat is for stats that require an up-to-date VersionInfo aka etag, which can't be cached.
Stats in cs3 also provide all extended attributes of a file in the form of
arbitrary_metadata
properties. As xattrs are extensively used throughout the code and currently cost an additional, redundantStat
call, an easy optimization is to cache the results and makegetxattr
calls just a cache lookup.The only caveat is for stats that require an up-to-date
VersionInfo
aka etag, which can't be cached.On the way, the code could also be improved by using https://googleapis.dev/python/protobuf/latest/google/protobuf/json_format.html