-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't indent already indented output when pretty-printing #2023
Comments
Hmm, I didn't notice this at all. I profiled Emacs and found that it spends most of the time garbage It's often a good idea to increase the GC limit (which is super conservative by default) - see http://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/
We have to see all usages in the codebase - I think it might be used somewhere for non-pretty printed results.
Sure. At the very list this can be added just for the cases that really need it (if any). |
I see there are just 5 usages of this function in the entire codebase, so it should be easy for you to find your way. Seems to me the only usage that really needs the
Take a look yourself and make the changes accordingly. Some of this uses of this function don't even output sexps, so there this is completely worthless. An oversight on our part I guess. |
- Add optional inhibit-indent argument to cider-emit-into-popup-buffer. - Inhibit indentation where output is already indented (pprint) or not sexps.
Note: Currently I believe the issue is with Cider, but it also relates
to recent changes on the master branch of Emacs, so I'm not entirely
sure this is the right place to post this report. I think this is more
of a feature request anyway.
Emacs has introduced lisp-indentation changes which don't reparse
the code as often as before and rely on previous parse-state to
improve performance. I believe this change is causing performance
issues with
cider-emit-into-popup-buffer
, when pretty-printingnon-trivial amounts of data.
I profiled Emacs and found that it spends most of the time garbage
collecting and
lisp-indent-calc-next
during pretty-printing.I've also found that if I comment out the
indent-sexp
call from thecider-emit-into-popup-buffer
function, the issue is gone.I'm not really sure what other features
cider-emit-into-popup-buffer
is used for (except pretty-printing), but don't pretty-print functions
already indent their output? Why is there a need for Emacs to indent
the output again?
If you agree, I can submit a pull request for
cider-emit-into-popup-buffer
with an optional parameter to inhibitindentation.
The text was updated successfully, but these errors were encountered: