auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Temporarily bind gc-cons-threshold


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] Temporarily bind gc-cons-threshold
Date: Sat, 19 Mar 2016 18:21:50 +0100

Hi all,

2016-03-05 0:44 GMT+01:00 Mosè Giordano <address@hidden>:
> Dear all,
>
> I recently read this interesting post
> https://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/
> which points out a trick for improving performance of functions
> mentioned in the documentation of `gc-cons-threshold': temporarily
> bind this variable to a high value.  In particular, the author of the
> post suggests to bind it to `most-positive-fixnum', which can actually
> be very large.  This strategy is also used in a few Emacs core
> packages, one of the highest values I found is 10000000.  What about
> doing the same in some places in AUCTeX?
>
> One of the first time-consuming functions that came to my mind has
> been `TeX-search-files-type-alist'.  Here are the result of a
> benchmark:
>
> --8<---------------cut here---------------start------------->8---
> (benchmark-run 10
>   (let ((TeX-search-files-type-alist LaTeX-search-files-type-alist))
>     (TeX-search-files-by-type 'texinputs 'global t t)))
> =>(5.607455037 30 0.9089236009999997)
>
> (benchmark-run 10
>   (let ((TeX-search-files-type-alist LaTeX-search-files-type-alist)
>     (gc-cons-threshold 10000000))
>     (TeX-search-files-by-type 'texinputs 'global t t)))
> =>(4.924593101 10 0.32471203299999996)
> --8<---------------cut here---------------end--------------->8---
>
> This is an improvement of ~12%, definitely not dramatic but shaving
> off a few hundredths of seconds from this function is a good
> achievement anyway.
>
> Comments?  Can you suggest other time-consuming functions that could
> benefit from this trick?  I thought about `TeX-auto-parse', but in
> most documents of mine it never triggers garbage collection.  Feel
> free to report here if you experience significant improvements when
> let-binding `gc-cons-threshold' in this function.

I installed this change only for `TeX-search-files-by-type'.  Should
you run into trouble for this please report it here.

Bye,
Mosè



reply via email to

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