nfs_fh3 type currently uses Cow<'_, [u8]>, which results in a significant memory footprint, nearly equivalent to using a fixed [u8; 64]. The primary downside of using Cow is that the owned variant requires heap allocations, introducing unnecessary overhead.
According to the NFSv3 specification:
nfs_fh3
struct nfs_fh3 {
opaque data<NFS3_FHSIZE>;
};
NFS3_FHSIZE 64
The maximum size in bytes of the opaque file handle.
Since NFS3_FHSIZE is a fixed 64-byte limit, it may be more efficient to replace Cow<'_, [u8]> with [u8; 64] or another more memory-efficient representation, avoiding dynamic allocations where possible.
nfs_fh3type currently usesCow<'_, [u8]>, which results in a significant memory footprint, nearly equivalent to using a fixed[u8; 64]. The primary downside of using Cow is that the owned variant requires heap allocations, introducing unnecessary overhead.According to the NFSv3 specification:
Since
NFS3_FHSIZEis a fixed 64-byte limit, it may be more efficient to replaceCow<'_, [u8]>with[u8; 64]or another more memory-efficient representation, avoiding dynamic allocations where possible.