Attached patch speeds up ansi-color. It tries to eliminate as many allocations (cons and list) as possible. Benchmarks, recorded in emacs -q, are in the second attachments. With the patch applied, there is a 26% speedup in elapsed time, mostly because the garbage collector has to take care of less allocations. Two less important side notes: 1) This patch additionally makes it very straight forward to add support for ANSI color codes 38 and 48 allowing 256-colors and 24bit full-color. I plan to submit such a patch later (for both ansi-color and term-mode). 2) Two vector variables, that were recently added by Jim, were merged into one. Adding him as CC. Best regards.