]> granicus.if.org Git - neomutt/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)
committerRichard Russon <rich@flatcap.org>
Fri, 10 Feb 2017 03:32:55 +0000 (03:32 +0000)
commitec77e25380553869c41def5a227ed1de2683ccb9
tree44a9a99f858290b023be906c3bdf59d3beda7f18
parent9a6fb311e8ec06110e1057c59d8686073ecea059
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
menu.c
mutt.h
pattern.c
protos.h
score.c