Open Yevgnen opened 2 years ago
Please provide more details for debugging. For example:
Hi, the issue seems happens for file with JSON lines, re-dumping the file to a list of dict seems kinda fixed the problem: Opening the file is fast, but scrolling is much slower than with tree-sitter-hl-mode
off.
json-mode
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption Blink-Cursor Electric-Indent File-Name-Shadow Font-Lock Global-Eldoc Global-Font-Lock Global-Tree-Sitter Line-Number Mac-Mouse-Wheel Menu-Bar Tool-Bar Tooltip Transient-Mark Tree-Sitter Tree-Sitter-Hl
(setq user-init-file (or load-file-name (buffer-file-name)))
(setq user-emacs-directory (file-name-directory user-init-file))
(require 'package) (add-to-list 'package-archives '("tromey" . "http://tromey.com/elpa/")) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (setq package-user-dir (expand-file-name "elpa/" user-emacs-directory)) (package-initialize)
;; Install use-package that we require for managing all other dependencies (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package))
(use-package json-mode :ensure t)
(use-package tree-sitter :ensure t :init (require 'tree-sitter) (global-tree-sitter-mode 1) (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))
;; Language bundle. (use-package tree-sitter-langs :ensure t :init (require 'tree-sitter-langs))
@Yevgnen do you get slowness also while updating the file? I am using https://github.com/milisims/tree-sitter-org in some large org files and I observe a significant slow down in Org Mode. Maybe these issues are related.
Hi. When I open a 3.5M JSON file using
json-mode
(not the built-injavascript-mode
) withglobal-tree-sitter-mode
andtree-sitter-hl-mode
are on, emacs takes about 20s to finish. With both modes are off, the file is opened instantly.My emacs version:
GNU Emacs 27.2 (build 1, x86_64-apple-darwin21.2.0, Carbon Version 165 AppKit 2113.2) of 2022-01-25
and below is the profiling result