Hacker News new | ask | show | jobs
by ridiculous_fish 4782 days ago
Current fish author here. Thanks for giving fish a try! I hope you tested a 2.0 branch build, and not the 1.x train from 2009 - a lot has changed since then, including major performance improvements. Check $FISH_VERSION if you are unsure.

'ls' is slower on fish because it passes the -G ("colorize”) flag to /bin/ls, which gives you nice colors, but requires a stat of each file to determine its type. If you want faster but uncolored output, you could redefine the ls function to invoke the ls command with no arguments:

    alias ls 'command ls'
For other instances of slowness or bad completions, we’d sure appreciate it if you opened an issue on the github page at http://github.com/fish-shell/fish-shell/issues/
1 comments

I just checked and fish is way slower at 'ls *' than zsh. (zsh was done 2x as fast even with a directory with more than 3x as much stuff in it)

I have also a few other flags set in my zsh aliases that's not in fish.

(Tested with 2.0b2)

fish passes the -G flag to 'ls' by default, which produces colorized output, but stats each file. So fish is actually outputting more information than zsh, and what your test is really measuring is the speed of '/bin/ls' vs '/bin/ls -G'

To compare ls speeds for the same workload, run it directly: /bin/ls. I expect no difference, because it is the same binary.

If you wish to compare globbing speeds, do not use bare ls, which does more work in fish. Instead, invoke the ls binary: '/bin/ls * '. Or better yet, just echo: 'echo *'.

I have ls aliased to 'ls -F -H --color=yes --group-directories-first', so no.

('/bin/ls *' is just as fast with '--color=yes' for me btw)