npostavs@users.sourceforge.net writes: >>> npostavs@users.sourceforge.net writes: >>> >>> Okay, I think I found the real fix now: > > Same issue with indent-region. The gains are not so dramatic for > typical lisp code that has normal size sexps, but C-x h C-M-\ on > subr.el's text runs twice as fast for me with the new lisp-indent-region > function. Had some test failures due to some corner cases, should all be fixed now. I think this is the final patch set. This also fixes lisp-indent-region and lisp-indent-line to not indent string literal contents. I intend to close this bug as fixed after merging these, as this does fix the performance bug. I will probably pursue the alternate pretty printer separately; it doesn't help performance (after the indent-sexp performance is fixed), but gives prettier results in some cases. The threading idea may also be worth looking at, but can also be considered separately, as this bug report is already long enough.