Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

strace can tell you what system calls it's doing, what the results are, and how long they're taking, which may help narrow it down.


Thanks. Interestingly, strace speeds up the operation. What took 50s after a cache drop now becomes immediate with "strace -f ls -U".

Dropping the cache and doing "time ls -U" gives:

    real   0m51,204s
    user   0m0,116s
    sys    0m0,718s
Update: never mind, it appears to be something in my shell. Switching to tcsh completely eradicated the problem.


It's probably that ls in the other shell is the builtin instead of the binary, when strace runs ls -U it does run the binary and not the shell builtin. tcsh must also delegate to the binary instead of a builtin, or their builtin is faster.


Yeah, I haven't figured it out yet, but when I do /bin/ls, then indeed the problem does not show. Probably a case of Bash trying to be smarter than it needs to be.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: