Not a real issue: Thank you for making this!
varenc opened this issue · comments
The slowness of lsof
on macOS has frustrated me for years. Only after spending more time using it on Linux did I realize it didn't even have to be this slow. I know you released this 7+ years ago, but even now in 2022 on macOS Monterey this works great for me.
Using lsof
to check what process is still using a drive I'm about to unmount now takes 42ms on average instead of over a minute! benchmark results:
$ hyperfine --max-runs 3 'lsof_fast +d /Volumes/Drive1' 'lsof +d /Volumes/Drive1' --ignore-failure
Benchmark #1: lsof_fast +d /Volumes/Drive1
Time (mean ± σ): 42.6 ms ± 2.1 ms [User: 9.1 ms, System: 31.4 ms]
Range (min … max): 41.2 ms … 45.1 ms 3 runs
Benchmark #2: lsof +d /Volumes/Drive1
Time (mean ± σ): 83.312 s ± 17.022 s [User: 227.1 ms, System: 72203.7 ms]
Range (min … max): 64.808 s … 98.305 s 3 runs
Summary
'lsof_fast +d /Volumes/Drive1' ran
1953.86 ± 411.17 times faster than 'lsof +d /Volumes/Drive1'
So anyway, thanks again for making this. Will close this not-a-real-issue now. Cheers!