Shinmera / file-attributes

Access to common file attributes (uid, gid, permissions, ctime, mtime, atime)
https://shinmera.github.io/file-attributes
zlib License
17 stars 2 forks source link

Inefficient use of syscalls #10

Closed dangerdyke closed 4 months ago

dangerdyke commented 4 months ago

Currently, file-attributes makes a separate statx call for every function in it's API. This is fine in trivial cases, but can have performance implications in situations where more then one attribute of many different files are required at once

What would be ideal in my view would be a function, on top of the existing API, to return a CL wrapper over the cffi statx struct.

I can start work on a PR for this later today if you think it's a wanted addition

Shinmera commented 4 months ago

Generally I don't look very kindly upon suggested protocol changes that only affect a specific platform, as in that case the portability aspect of the library is lost, and implementation internals are leaked.

I would be in favour of this if the public-facing API got a new call that returns all attributes, with an implementation of that function for every backend, using the minimal number of syscalls to do so.

dangerdyke commented 4 months ago

yeah I agree that expanding the API portably would be best. I don't have devices to develop/test with windows or macOS however, so someone else would need to work on those backends

Shinmera commented 4 months ago

For windows you can run sbcl through wine no problem.

For macos I... don't really care, though you can also use something like quickemu to set up a VM and test that way.