auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speeding up AUCTeX's parsing


From: Arash Esbati
Subject: Re: Speeding up AUCTeX's parsing
Date: Wed, 19 Jul 2023 22:06:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Tassilo,

Tassilo Horn <tsdh@gnu.org> writes:

> These are the results with the largest and most complex LaTeX document
> I've ever written:

Thanks for your response, Dr. Horn ;-)

>   (7.79938455 43 3.516914559)
>   (4.881446238 0 0.0)

Well, the impact is there (as also reported by Uwe, thanks BTW).

> The above effectively forbids gc during parsing and I'm not sure what
> would happen when a very large file is parsed on a system with little
> memory then.

Thanks for raising this.  Yes, I had that on my mind, I just wanted to
hear first if we should investigate here.

> Maybe it would be better to use a gc-cons-percentage value of 0.5 or
> something.  With that, I get
>
>   (5.124124372000001 6 0.5745011899999923)
>
> which is not much slower but doesn't forbid gc altogether.

`gc-cons-percentage' was next on my list.  What Do you think about a
change like this:

--8<---------------cut here---------------start------------->8---
(defun TeX-normal-mode (&optional arg)
  "Remove all information about this buffer, and apply the style hooks again.
Save buffer first including style information.
With optional argument ARG, also reload the style hooks."
  (interactive "*P")
  (if arg
      (dolist (var TeX-normal-mode-reset-list)
        (set var nil)))
  (let ((gc-cons-percentage 0.5)) ;;; <==== Line added!
    (let ((TeX-auto-save t))
      (if (buffer-modified-p)
          (save-buffer)
        (TeX-auto-write)))
    (normal-mode)
    ;; See also addition to `find-file-hook' in `VirTeX-common-initialization'.
    (when (eq TeX-master 'shared) (TeX-master-file nil nil t))
    (TeX-update-style t))  )
--8<---------------cut here---------------end--------------->8---

Best, Arash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]