summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/metalogo/git@texlive.info:texlive
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2024-08-06 10:30:49 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2024-08-06 10:30:49 +0000
commit04b946905552c11250d135edf71be9db23fcb55d (patch)
treeed21d203021e482963f4acf64364b7038158338c /Master/texmf-dist/source/latex/metalogo/git@texlive.info:texlive
parentc0af5e48fe35f3826c9b8b686dd10c6d47196ca1 (diff)
[CWEB] Refine PDF-related macros.HEADtrunk
Martin Ruckert's talk at TUG'24 about 'Profiling TeX' (watch on YouTube: https://www.youtube.com/live/d7vTW7PR0B4?t=7795s) and the ensuing private discussion with him lead me to inspect the relevant parts of 'cwebacromac.tex' (and 'pwebmac.tex') more closely in order to address the performance issues with certain large C/WEB programs. The most glaring example is MP.W, where every advanced TeX engine (for PDF and HINT) virtually stops for 1--2 seconds (on my machine) at two of the index pages because of the huge lists of section references for the variable 'mp' and the type 'MP' that are used 'everywhere'. (See below.) At this point, we haven't solved the quadratic performance behavior yet. However, the main changes applied in this commit at least slightly improve the macros and their application. In the overall context of the 'knuth-pdf'/'knuth-hint' packages, the 'index issue' reported by Martin becomes more or less irrelvant. The script 'makeall' produces 58 PDF documents in the main run. With all optimizations applied, the runtime is reduced by mere seconds from '1m7s' to '0m59s' (with 'pdftex'). (a) '\pdflink' and '\HINTlink' have lost their second parameter, which was only used with 'plain TeX plus dvipdf' and 'XeTeX' anyway. This cut down the replacement strings significantly. In one example I observed a runtime improvement of about twenty percent (2--3 seconds) by this change alone. (b) Macros '\makeoutlinetoks' and 'outilnedone' swallowed the surrounding macro calls, thus simplifying their application. (c) '\newcount\countC' was replaced with '\newif\ifhavenum' to avoid arithmetic with '0' and '1' for a simple Boolean operation. (d) '\newcount\countD' was renamed to '\countNOS'. (Unrelated.) In order to address the 'worst' CWEB code MP.W mentioned above, I changed both the macros and the 'makeall' script. My local MP.CH changes the '\inx' macro to address two 'Overfull \hboxes', so it is easy to remove the use of '\pdfnote' when setting up the index. Instead, 'makeall' invokes SED to amemd the MP.IDX file created by CWEAVE with the necessary '\pdflink' macro invocations for all section numbers in one fell swoop. This cuts the processing time for MP.TEX in half (!!). However, I do not intend to incorporate this approach into 'cwebmac.tex'/'pwebmac.tex' because this would most likely require '--shell-escape' and become too system-dependent. For small to midsize C/WEB programs, this would show minor improvements anyway. Watch this space for possible further improvements. (I'll hold back the releases of 'CWEB 4.12' and 'pwebmac 5.0' for the time being.) git-svn-id: svn://tug.org/texlive/trunk@71979 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/metalogo/git@texlive.info:texlive')
0 files changed, 0 insertions, 0 deletions