Subject: Re: bug#7089: 23.2; slow ansi-color-apply

From: Stefan Monnier <[email-masked]>
Date: Thu, 25 Nov 2010 11:31:01 -0500

>>> Do you know for sure string-match is slower (more CPU intensive) than
>>> re-search-forward?
>> They should be largely equivalent.  The difference between the two codes
>> might be due to replace-match and substring.  I.e. the original
>> ansi-color-apply should be at least as efficient as your code (if not
>> more) in the case where there are no SGR escape sequences.
> I was setting out to profile the two versions of the function and
> unfortunately I was not able to see the CPU shootup mentioned in the
> first message. My result shows my version of ansi-color-apply is almost
> twice as slow as the original one. (The code and data used for profiling
> are attached.)

OK, thanks.  As mentioned, it might depend on the density of SGR escape
sequences (and on the size of the text chunks processed, which can
depend on the machine load).

        Stefan