[tex-k] Speed of kpsewhich when querying the repertories of the TeX installation

jfbu jfbu at free.fr
Sat May 2 17:07:35 CEST 2015


Le 1 mai 2015 à 09:10, Norbert Preining <preining at logic.at> a écrit :

> IF you are so conservative about it, why not add to your .profile:
> 	TEXMFLOCAL=$(kpsewhich -var-value TEXMFLOCAL)
> 	TEXMFHOME=$(kpsewhich -var-value TEXMFHOME)
> 	export TEXFMLOCAL TEXMFHOME
> and all will be hell of a speed fast....
> 
> Isn't that the simplest solution for all your problems?

It would add the kspewhich extra-time to the launching time 
of all things.

I will complete and finish, in case there are people interested, 
my story here.

Emacs/AUCTeX 11.88 called kpsewhich 9 times during launch.

On my 2012 MacBook Air, which whenever I could compare it to anything
else, for example regarding the speed of execution of Python programs, 
is reasonably fast and has a 250G SSD, this meant a wait of 5 seconds
with the kpathsea library of TeXLive 2014.

(CPU 2 GHz Intel Core i7, Memory 8 Go 1600 MHz DDR3, 250Go SSD)

Developers of Emacs/AUCTeX have released 11.88.5 which calls
only 3 times kpsewhich during launch. 

Thus the loading time has been divided by 3.

Notice that AUCTeX 11.86 did only 2 calls to kpsewhich, not 9,
hence that issue was not easily perceived earlier. Besides,
it is a non-issue for people with environment variables set.

Although kpsewhich from TL2015 will be six times faster
on Mac OS, it is still frustrating to have perhaps still 
75% of the launching time of AUCTeX mode explained by these 
remaining 3 kpsewhich calls.

Thus I have decided in the end that I will set up environment
variables.

Fortunately I have on my System the TeX Distribution Panel
with its accompanying bunch of symbolic links in /Library/TeX
allowing single-click move from one distribution to another.

The collection and names of symbolic links in the various 
/Library/TeX/Distributions/TeXLive-YYYY.texdist
are a bit baroque at times and examining the ones I found
I needed to make a few fixes, but this will solve my problems.

Thus I now have this in my bash_profile:

TEXDISTRIBCONTENTS="/Library/TeX/Distributions/.DefaultTeX/Contents"
export TEXMFSYSVAR="$TEXDISTRIBCONTENTS/TexmfSysVar"
export TEXMFLOCAL="$TEXDISTRIBCONTENTS/TexmfLocal"
# export TEXMFDIST="$TEXDISTRIBCONTENTS/AllTexmf/texmf-dist"
# export TEXMFMAIN="$TEXDISTRIBCONTENTS/AllTexmf/texmf" # -> texmf-dist if >2012
# The above needed for TeXLive2012 and earlier
# but as AUCTeX will not see with TeXLive2013+ that this texmf and texmf-dist
# are in fact the same, the duplicate repertory will not be pruned. I don't
# know how these repertories are used, thus I prefer to drop <2013 support
# Thus:
export TEXMFDIST="$TEXDISTRIBCONTENTS/Root/texmf-dist"
export TEXMFMAIN="$TEXMFDIST"
export SYSTEXMF="$TEXMFSYSVAR:$TEXMFLOCAL:$TEXMFDIST"
export TEXMFHOME="/Users/---/Library/texmf"

This is because SYSTEXMF, TEXMFLOCAL, TEXMDIST, TEXMFMAIN, TEXMFHOME
are the things which are queried by AUCTeX 11.88 via kpsewhich.

With this set-up I don't have to change or re-source my 
environment variables, I may switch my current distribution
with a single change of one symbolic link
/Library/TeX/Distributions/.DefaultTeX/Contents
(which is done in GUI via the TeX Dist Pane)
and the environment variables need no adjustments.

Only /usr/texbin is added to the PATH, and /usr/texbin is itself
a symbolic link whose ultimate destination depends on the current
/Library/TeX/Distributions/.DefaultTeX/Contents
symlink.

Jean-François









More information about the tex-k mailing list