Skip to content

remove allocation in nfs_fh3 #53

@Vaiz

Description

@Vaiz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions