Commit a9969d0e authored by Dmitry Gutov's avatar Dmitry Gutov

etags-regen--update-file: Speed up dramatically

^ turned out to be a very expensive anchor.  It was the difference
between a "real" regexp search and a literal search, and the latter's
much faster.  And since we're searching literally, might as well use
parent d81f30a9
Pipeline #8676 failed with stage
in 89 minutes and 21 seconds
......@@ -178,16 +178,12 @@ File extensions to generate the tags for."
(setq should-scan t))
((progn (set-buffer tags-file-buf)
(goto-char (point-min))
;; FIXME: With a big enough TAGS, even this can be
;; slow (and, unfortunately, synchronous). Using the
;; project-relative name here speeds it up, but only
;; by ~30%. Some indexing could help.
(re-search-forward (format "^%s," (regexp-quote file-name)) nil t))
(let ((start (line-beginning-position)))
(re-search-forward "\f\n" nil 'move)
(search-forward (format "\f\n%s," file-name) nil t))
(let ((start (match-beginning 0)))
(search-forward "\f\n" nil 'move)
(let ((inhibit-read-only t)
(save-silently t))
(delete-region (- start 2)
(delete-region start
(if (eobp)
(- (point) 2)))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment