https://bugzilla.mindrot.org/show_bug.cgi?id=3931

            Bug ID: 3931
           Summary: wildcard decimates directory listing performance (sftp
                    ls)
           Product: Portable OpenSSH
           Version: 9.9p1
          Hardware: amd64
                OS: Windows 11
            Status: NEW
          Severity: normal
          Priority: P5
         Component: sftp
          Assignee: [email protected]
          Reporter: [email protected]

For directories containing many (150+) files:

sftp> ls dir

is an order of magnitude faster than

sftp> ls dir/*


This amount of difference seems inexplicable (both produce identical
output).

Similarly, "ls -l dir/*" takes about 10x longer than "ls -l dir". This
is particularly unfortunate because the former includes the prefix
("dir/") in its output but the latter omits it. For batch use it would
be convenient to produce output lines that include both the file size
(bytes) and the fully qualified filename (including directory prefix)
without severely impinging on performance.

For directories with ~5000 files, using a wildcard makes sftp appear to
hang (nonresponsive to CTRL-C).

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
[email protected]
https://lists.mindrot.org/mailman/listinfo/openssh-bugs

Reply via email to