-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Much lag for large files (>4000 lines) #369
Comments
Ditto. |
Please try: (setq blink-matching-paren nil) |
That seems to have fixed the problem for me (or at least so far!) Thanks! |
Although the blink-matching-paren fixed some issues, I'm still having problems with large files. Doing a profile during a couple of long hangs revealed these as the top CPU users:
This might be slow even without the GCs, but it seems like something in get-token-internal is creating a lot of garbage? |
Just how large are the files we are talking about? |
The one I ran the profile on is 6000 lines. I can provide it to you (offline) for testing if that would help. |
Before we do that, have you tried reproducing the problem starting with The scenario would look something like this:
|
Yes, I get the same behavior in -Q. |
All right, please send me the file. My email is at the top of |
Thanks, I see it there. Seeing as the reproduction scenario involves typing characters from Ultimately, it's a bug in diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 6d995a0..0ba7aac 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1851,7 +1851,8 @@ js--multi-line-declaration-indentation
"Helper function for `js--proper-indentation'.
Return the proper indentation of the current line if it belongs to a declaration
statement spanning multiple lines; otherwise, return nil."
- (let (at-opening-bracket)
+ (let (forward-sexp-function ; use Lisp version even in js2-mode
+ at-opening-bracket)
(save-excursion
(back-to-indentation)
(when (not (looking-at js--declaration-keyword-re)) And I'll try to get it into the upcoming Emacs release (25.2). |
I'm not sure how I'm "supposed" to patch Emacs, but putting a fixed version of the function into my .emacs file seemed to work, because the hangup is now gone. Thanks a bunch, Dmitri! Really appreciate the effort! |
You apply the patch the sources, and rebuild. 😛 If Emacs was built by your distribution, it's harder, of course.
That works as well. And yet another option is to define an around-advice for this function, with a let-binding for the aforementioned variable. You're welcome! |
And done. |
As the title says, tested on Windows 10. It is very tedious to work because every character I type has 1-2 second delay to it. If more info is needed I can do profiling.
The text was updated successfully, but these errors were encountered: