Hello, On Tue, 30 Oct 2018, Per Jessen wrote:
Anton Aylward wrote:
On 30/10/18 12:36 PM, Per Jessen wrote:
I was just wondering if e.g. 'find' or 'ls' had some options that would limit the scope ? (not mtime etc).
Well, I'd start with the "-f -- do not sort" option. Sorting means slurp up *everything* into memory, which is going to involve a lot of virtual memory work and probably paging to get there.
It's not memory that is the problem - the box has 64Gb. I tried 'ls -f', made no difference although I did not let it finish - the last 'find' ran for 14 hours before I had to stop it.
What you really want is "read one/print one" or "read one/process one"
Yep and that is more or less what the code does - do one getdents(), process it, rinse, repeat. With that I can list 3+ million files in minutes. It just seems to me 'ls' and 'find' ought to be able to do the same.
Weird. Both 'find' and 'ls' just do that (wrapped in a readdir(3) possibly). Could you compare an $ ltrace -S -efile ... of ls/find vs. your "just getdents" code? A small sample dir (-tree) should suffice to spot the diff (when ls/find don't sort)... Oh, well, yeah, ls _does_ need to stat if it's to print dates and stuff, so keep that in mind. -dnh ObSigNote: *bwah* Somewhen, all the fun was pruned... And now a CoC? Whut?!?!!! -- prom_printf("Detected PenguinPages, getting out of here.\n"); linux-2.0.38/arch/sparc/mm/srmmu.c -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org