Open guibor opened 1 year ago
Thanks for reporting. I think we would need more details. Would you be keen troubleshoot and see if you can perform specific actions and measure memory usage before and after? Can't say I have any Emacs experience in this space. I could use the help.
What specific actions or extra details do you suggest? Happy to help.
Can't say I'm familiar with debugging Emacs memory issues. Anything you can do to try to isolate user actions that lead to memory consumption (and measure) would be helpful. If you figure out a way to measure (maybe after explicitly invoking garbage collector), could also be used to check if memory is restored when shell buffers are killed.
Source highlighting is pretty innefficient at the moment. Added chatgpt-shell-highlight-blocks
so it can be turned off. Try that and see if you notice better performance.
Also, it'd be good to know if the sluggishness goes away if the shell buffers are killed.
I will try it out. I'm optimistic, because the times at which I feel the greatest lag are indeed when the shell refreshes to highlight a new code block (at times Emacs goes blank until the buffer refreshes).
Buffers killed doesn't seem to help though.
I can confirm that it is the block highlighting that is affecting performance. Might be worth optimizing.
Not had a chance to look into this. In the mean time, maybe this helps (after clearning or killing shell buffers)? https://indieweb.social/@lispi314@mastodon.top/111184372065140896
(when (symbol-function 'malloc-trim)
(add-hook 'post-gc-hook #'malloc-trim))
Thanks for the suggestion. 'malloc-trim is not defined though in my version of emacs (Mac osx)
Looks like I've run into some issues as well. I've been having some sluggish/slow behavior in emacs for a while but couldn't pin it down until now. Looks like chatgpt-shell syntax highlighting is the source.
Only when there is visible colorized text (eg code block), that's when the slowness kicks in.
Turning off syntax highlighting for now
Whenever I use
chatgpt-shell
I notice the performance of my Emacs slowly degrading and it's memory footprint increasing to amazing sizes.