Huge delay for accesibility of tide's functionality #1472
I have tested this issue on my working project with more than 5000 ts and tsx files. And so huge (30-90 seconds) delay noticed only there. Unfortunately I can't share that project.
Packages that installed
They specified below in my
Steps to reproduce
The issue will not occur again in the same file when it happens once.
Same issue happens when I write something like 'asdasd' in the new line and then place pointer at imported variable.
This issue happens both on linux and windows machines.
Outputs and init config from linux
(setq custom-file (substitute-in-file-name "$HOME/.emacs.d/custom.el")) (load custom-file) ;; turn off menu, scroll, tool bars (if (display-graphic-p) (progn (tool-bar-mode -1) (scroll-bar-mode -1) (menu-bar-mode -1))) ;; list the packages you want (setq package-list '(add-node-modules-path tide web-mode)) ;; list the repositories containing them (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("marmalade" . "https://marmalade-repo.org/packages/") ("melpa" . "https://melpa.org/packages/"))) ;; activate all the packages (in particular autoloads) (package-initialize) ;; fetch the list of packages available (unless package-archive-contents (package-refresh-contents)) ;; install the missing packages (dolist (package package-list) (unless (package-installed-p package) (package-install package))) ;; this for prevent tsserver from triggering when temp files appears in project ;; turn off lock files (setq create-lockfiles nil) ;; placing all files in one directory (setq backup-directory-alist `((".*" ., temporary-file-directory))) (setq auto-save-file-name-transforms `((".*", temporary-file-directory t))) (eval-after-load 'web-mode '(add-hook 'web-mode-hook #'add-node-modules-path)) (eval-after-load 'typescript-mode '(add-hook 'typescript-mode-hook #'add-node-modules-path)) ;; tide ;; this snippet from tide's repository (defun setup-tide-mode () (interactive) (tide-setup) (flycheck-mode +1) (tide-hl-identifier-mode +1) ) (add-hook 'typescript-mode-hook #'setup-tide-mode)
The problem dissapear if remove
The text was updated successfully, but these errors were encountered:
Thank you for the report. We do care about performance, but we seldom get the chance of stress-testing Flycheck like your project seems to do.
It looks like
Although I don't yet understand why
I would also be interested to know how long it takes to call
Finally, please share a profiler report by doing
Emacs does respond almost all the time before variable will be highlighted (I can move cursor).
It takes one second if I lint one file by next command:
node_modules/tslint/bin/tslint -c tslint.json --format json filePath/someFileName.ts
And it takes two minutes if I lint entire project with:
node_modules/tslint/bin/tslint -c tslint.json --format json --project tsconfig.json
If it can help, I've noticed that nodejs process became 30-40% loaded in my "waiting" time.
I've reproduced the hang by typed some random symbols at new line and then moved pointer to imported variable:
Same report in gist
Hi, sorry about delay, had to find some free time to look at this issue. I was not sure that
Tide will start tsserver when opening first ts file in project. Tsserver will load temporally files that Flycheck
When going to definition, flycheck will also check newly opened file, with new temp file created. When you go back with
That helps a lot and you can use it until PR is reverted. Can you check it out and see if it works for you too?
I'm sure @cpitclaudel will be happy about reverting the
I don't follow why jumping around with
Possible explanation: the server is single-threaded, and when it detects a new file in the current folder it likely starts processing it, being unresponsible until it's done with that.
10 seconds I have on windows and 15 seconds on linux with vscode project.
I think it's because my computer with linux much weaker than another computer with windows.
It's much better, thank you, just tested on my weak linux machine on both projects and there is no delay for variable highlighting after jumping to definition forward and back.