GNU Global Created gtags Too Large

Asked 1 years ago, Updated 1 years ago, 47 views

GNU Global is creating a huge file with a gtags file greater than or equal to 10G.
As a result, the CPU and memory are running at full capacity and are completely useless. Yes,
We are currently killing Python in ActiveMonitor and removing huge gtags.

I'm sorry to ask you a vague question, but I'd like to ask you about GNU Global's performance
Please tell me how to improve it.

The environment is MacOS X10.10.5
Install Global with Homebrew and version 6.5.1


The Emacs configuration is as follows:
Update gtags only when editing ruby, c++, c files
I'd like to, but this might be the bad thing.
If ruby file and image file are in the same folder
Are they indexing together?
Is this the reason? Maybe.

(defun update-gtags()
(interactive)
(set-process-sentinel
) ;; Run global-u behind the scenes
(start-process"gtags-update"nil"gtags" --gtagslabel=pygments")
(lambda(proc change)
;; Show messages when successful
(when (string-match "finished" change)
(message "GTAGS is updated")

(add-hook'ruby-mode-hook
) US>'(lambda()
(add-hook'after-save-hook' update-gtags))
(add-hook'c++-mode-hook
) US>'(lambda()
(add-hook'after-save-hook' update-gtags))
(add-hook'c-mode-hook
) US>'(lambda()
(add-hook'after-save-hook' update-gtags))

emacs

2022-09-30 16:42

1 Answers

In addition to the possibility that unnecessary files are being indexed, there is a possibility that files with a very long line are being indexed.

Because of the GPATH, GTAGS, and GRTAGS generated by gtags, GTAGS takes in the original source code line, a very long file can cause the GTAGS file to become bloated and take longer to generate.

For automatically generated files, such as JavaScript minimized files, one line may be longer.

If you run gtags with the -v option, you will see the file name to be processed, so you will be able to find unnecessary or slow files.


2022-09-30 16:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.