On 07May2013 15:14, hubert depesz lubaczewski <dep...@depesz.com> wrote: | I have this rule in my muttrc: | color body color163 default "(http|https|ftp)://" | (this is simplified version, I was checking if there are no problems | when using more complicated things). | | And it works fine. | | But - every now and then I get email that is rather large (64kB), and it | contains many urls (~ 900). | And in this case - displaying such mail takes long time (6-8 seconds).
Does it take this long with the simplified regexp above, or only your more complicated ones? It is possibly to accidentally write quite expensive regexps. | Strace shows that the time is not spent in any syscall, so I guess it's | internal processing. You should be able to see mutt show up in top; that would be more obviously cpu bound. Just for reference. | Is there any way to speed up such coloring? Regexp efficiency is important. If you're actually using more complex regexps we should see them. Your small regexp above looks pretty good though. | Or, perhaps - make color rule work only for messages smaller than x kB ? Hmm. Maybe. message-hooks run before the display fires, so you could write something like: message-hook . 'uncolor body "(http|https|ftp)://"'' message-hook "~z 1-16384" 'color body color163 default "(http|https|ftp)://"' Note that the "uncolor" must use _exactly_ the same pattern as the "color". Cheers, -- Cameron Simpson <c...@zip.com.au> ep0: 3c509 in test mode. Erase pencil mark! This means that someone has scribbled with pencil in the test area on the card. Erase the pencil mark and reboot. (This is not a joke). - OpenBSD 2.3 ep(4) ethernet drive manual entry