auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Long loading time


From: jfbu
Subject: Re: [AUCTeX] Long loading time
Date: Fri, 01 May 2015 09:11:11 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

Le 01/05/2015 01:12, Tassilo Horn a écrit :
jfbu <address@hidden> writes:

Le 30/04/2015 23:43, Tassilo Horn a écrit :
What is not right?


To call kpsewhich separately for each, kpsewhich allows
to do one single call, but then you will want to prune out
the duplicate repertories

We do that anyway.  Could you try if this gives better results than
caching?

--8<---------------cut here---------------start------------->8---

Thanks Tassilo for working on this issue.

For people reading this thread, let me again explicitely state
that if they have environment variables set for TEXMFHOME etc...
they will not have seen the issue as acutely as I have.

(I just tested with env TEXMFHOME="/tmp" etc.... to time the
kpsewhich calls below, and they complete instantaneously)

I have applied the patch. Now the loading time is divided by three,
going down from 5 seconds to about 1.5 seconds. (on TL2014,
on TL2015, we go down from 1 second to 1/3 of a second)

And I see indeed only three calls to kpsewhich

kpsewhich --progname latex --expand-path 
$SYSTEXMF:$TEXMFLOCAL:$TEXMFMAIN:$TEXMFDIST
kpsewhich --progname latex --expand-path $TEXMFHOME
kpsewhich --progname latex --expand-path 
$TEXMFHOME:$TEXMFMAIN:$TEXMFLOCAL:$TEXMFDIST

If there was a way to combine the three into one, that would gain
an additional factor of 3 in launch time of AUCTeX.


diff --git a/tex.el b/tex.el
index b7ffc1f..4a1442e 100644
--- a/tex.el
+++ b/tex.el
@@ -640,7 +640,7 @@ overlays between two existing ones.")
  (when (featurep 'xemacs)

    (defun TeX-read-string
-    (prompt &optional initial-input history default-value)
+      (prompt &optional initial-input history default-value)
      (condition-case nil
        (read-string prompt initial-input history default-value t)
        (wrong-number-of-arguments
@@ -2358,15 +2358,18 @@ trees.  Only existing directories are returned."
    ;; several elements separated by "/".
    (let (path-list path exit-status input-dir-list)
      (condition-case nil
-       (dolist (var vars)
+       (progn
          (setq path (with-output-to-string
-                      (setq exit-status (call-process
-                                         "kpsewhich"  nil
-                                         (list standard-output nil) nil
-                                         "--progname" program
-                                         "--expand-path" var))))
+                      (setq exit-status
+                            (call-process
+                             "kpsewhich"  nil
+                             (list standard-output nil) nil
+                             "--progname" program
+                             "--expand-path"
+                             ;; FIXME: Don't assume : is the path separator
+                             (mapconcat #'identity vars ":")))))
          (when (zerop exit-status)
-            (pushnew path path-list :test #'equal)))
+           (pushnew path path-list :test #'equal)))
        (error nil))
      (dolist (elt (nreverse path-list))
        (let ((separators (if (string-match "^[A-Za-z]:" elt)
--8<---------------cut here---------------end--------------->8---

As an aside notice that SYSTEXMF by default already produces TEXMFDIST
and TEXMFLOCAL

at least that the default set-up in texmf.cnf

If I user is free to change that, we cannot take it for granted.

Well, I don't know for sure what the user is free to (reasonably) change.

I believe "users" do not change much, apart from the guys preparing
the Linux distros. I wonder if they set some (global) environment
variables then, which would alleviate the issue anyhow.

Best

Jean-François






reply via email to

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