diff options
author | Karel Zak <kzak@redhat.com> | 2011-02-04 22:44:31 +0100 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2011-03-10 11:48:33 -0800 |
commit | b0006b6ea2357572637b0c7946dfd074cfe18178 (patch) | |
tree | fcf19381097dc453c1dfe64ea5431d02b34e8539 /gmime-filter-headers.h | |
parent | 2d6718b837b11b48d6b6ce1ae3f863591d5b651a (diff) |
new: read db_files and db_subdirs only if mtime changed
The db_files and db_subdirs are unnecessary for unchanged directories.
maildir with 10000 e-mails:
old version:
$ time ./notmuch new
No new mail.
real 0m0.053s
user 0m0.028s
sys 0m0.026s
new version:
$ time ./notmuch new
No new mail.
real 0m0.032s
user 0m0.009s
sys 0m0.023s
Signed-off-by: Karel Zak <kzak@redhat.com>
Reviewed-by: Austin Clements <amdragon@mit.edu>
Looks good (faster than, but provably equivalent to the original code!
notmuch_directory_get_child_* are side-effect free,
db_files/db_subdirs aren't used between where they were set in the old
code and where they are set in the new code, and db_files/db_subdirs
are initialized to NULL when declared).
Another timing data point:
Old code: ./notmuch new 0.77s user 0.28s system 99% cpu 1.051 total
New code: ./notmuch new 0.09s user 0.27s system 98% cpu 0.368 total
Diffstat (limited to 'gmime-filter-headers.h')
0 files changed, 0 insertions, 0 deletions