On śro, maj 08, 2013 at 09:24:12 +1000, Cameron Simpson wrote:
> 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.

Yes. It is slow even with simpler regexps.
It looks like if the regexp matches many times (900?) in single message
it gets really, really slow.

> You should be able to see mutt show up in top; that would be more
> obviously cpu bound. Just for reference.

Sure, but I was more interested to see if I can find what it is doing,
than that it is doing something :)

> | 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.

It works just the same with simplest possible regexps (http://), if they
match many times.

> | 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".

That's interesting idea. Thanks.

Best regards,

depesz

Reply via email to