Bug#563270: grepmail: options to parse mbox in reverse order and to stop after a while
For date-based searches, if there was an option to search the input from
bottom to top, and/or to stop after reaching a specified number of hits,
it would be significantly faster than what we get now. For example:
% ls -l randommbox
-rw------- 1 joy joy 29640019 2010-01-01 12:32 randommbox
% time grepmail -d 'since 5 days ago' randommbox | grep -c ^Date:
grepmail -d 'since 5 days ago' randommbox 14,88s user 0,31s system 99% cpu 15,201 total
grep -c ^Date: 0,00s user 0,00s system 0% cpu 15,200 total
% time tail -10000 randommbox | grepmail -d 'since 5 days ago' | grep -c Date:
tail -10000 randommbox 0,00s user 0,00s system 0% cpu 0,946 total
grepmail -d 'since 5 days ago' 0,92s user 0,07s system 98% cpu 1,007 total
grep -c Date: 0,00s user 0,00s system 0% cpu 1,005 total
The trouble with the tail(1) above is that it's just a guess.
2. That which causes joy or happiness.