nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] MH-W intro/help request

2014-12-02 12:36:31
Specifically, I was testing it on a very large folder of approx 100K
messages.  Both the "mark ..." and a "show N" invokation take about
the more than 1/10th of a second on average, even for extremely short
outputs.

Okay, yeah, THAT makes sense.  Pretty much every command calls folder_read(),
and I am 99% sure the problem there is doing a readdir() on that super huge
directory (it's not performing a stat() on every file, though).  Obviously
the output size isn't the problem.  Note that maybe the problem is we do
something stupid with malloc or something else; it might be interesting
to see how long things like "ls" take in that directory (running ls without
stat()ing any files, of course); if it's significantly faster then maybe
we can do better.

We're kind of in a tough spot here.  Sequences can contain entries for
messages that don't exist; the way that gets resolved is by reading the
directory and removing any files from the sequence list when the folder
data structure is built. mark(1) isn't just reading the sequence file
and printing out the exact line; it's calling seq_print(), which is
the same routine that the sequence routines use to output the sequence
structure.  Getting the sequence list without actually reading the
folder ... well, it's possible, but it would require some surgery.

I did see a web page suggested speeding up readdir() by replacing it
with direct calls to getdents() with a larger buffer size; I'm not
sure I want to do that either, as direct usage of getdents() isn't
portable.  I'm open to suggestions here.

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>