On macOS, getxattr() is surprisingly slow, several times slower than running listxattr on the same file. (It seems like getxattr() is doing security checks before determining whether the xattr exists or not).
On macOS 14.5, timing for 30000 calls to the following functions (the target file contains no xattrs): ``` lstat: 29729459 ns getxattr: 110323334 ns listxattr: 14672500 ns ```
And a Wine test that calls FindFirstFile 2500 times with a path of "C:\windows\system32\*.nonexistent": ``` currently: 12119 ms with this patch: 5580 ms ```