lsof is so slow on Mojave. Any alternatives or improvements?
Regarding https://discussions.apple.com/thread/250297792
lsof also slow for me in Mojave.
At first I thought it was a problem with macOS 10.14. But I think the issue is with lsof itself.
The newer version of lsof included with Catalina, 4.91, it is MUCH faster.
Mojave comes with lsof 4.89
Catalina comes with lsof 4.9.1
(also, for reference, High Sierra comes with lsof 4.89)
Here are the 2 lsof versions run on same machine 10.14.6 (18G3020),
4.89
time lsof | wc -l
4472
real 0m14.250s
user 0m0.101s
sys 0m14.086s
4.9.1
time /usr/local/lsof4.9.1 | wc -l
4474
real 0m0.197s
user 0m0.075s
sys 0m0.114s
I will still default to 4.89 as that is what came with Mojave, but I have 4.91 unhand for troubleshooting.
Hope this helps some peeps.
Bernuli