]> granicus.if.org Git - mutt/commit
Add a pattern_cache_t to speed up a few repeated matches.
authorKevin McCarthy <kevin@8t8.us>
Tue, 3 Jan 2017 02:08:17 +0000 (18:08 -0800)
committerKevin McCarthy <kevin@8t8.us>
Tue, 3 Jan 2017 02:08:17 +0000 (18:08 -0800)
commit522c26d54379b38d3dbdc7d1537eee075157841a
treeb59463d6634343de651e0abe6f8fcc8d29b6c7e9
parent17030b4700a498161ff5ab1eda28f0750cdbceb2
Add a pattern_cache_t to speed up a few repeated matches.

Vincent Lefèvre reported experiencing an index display performance
issue.  This occurred with messages containing many recipients.  He
had many index color lines containing ~l.  The ~l ended up being run
over and over on these messages, resulting in a noticable slowdown
displaying the index.

This patch adds caching for just a few of the pattern operations (~l,
~u, ~p, ~P) that are potentially expensive and also don't have
arguments.  The caching is only enabled for operations repeatedly
matching against the same message: color, hooks, scoring.

The caching is fairly targeted, but isn't that invasive or
complicated.
curs_main.c
hook.c
mutt.h
pattern.c
protos.h
score.c