GNU bug report logs -
#7089
23.2; slow ansi-color-apply
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Thu, 23 Sep 2010 09:14:02 UTC
Severity: normal
Found in version 23.2
Done: Leo <sdl.web <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>> The following version fixed some glitches in setting ansi-color-context.
>>> Also I have received an email from Alex that welcomes the improvement.
>>> Let me know if I should send a patch in.
>> Yes, a patch would be nice. Also a ChangeLog explaining the change
>> (which should hopefully explain why the new code is faster) would
>> be welcome.
> Attached to the end of this message. I basically rewrite
> ansi-color-apply using re-search-forward (as in
> ansi-color-apply-on-region) which seems to be an order more efficient
> than string-match.
> I have been using the new version in eshell and it is almost as
> efficient as ansi-color-apply-on-region. It is very painful to use the
> original ansi-color-apply.
Any reason why your new code does something similar to
ansi-color-apply-on-region rather than calling
ansi-color-apply-on-region?
> 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.
Stefan
This bug report was last modified 14 years and 258 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.