diff options
author | Karl Berry <karl@freefriends.org> | 2024-02-25 17:08:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-02-25 17:08:15 +0000 |
commit | 3b675bbf1beaad64bd8d13bd091d872c64e3c501 (patch) | |
tree | aeaad52445fd8ae24478578bb975717082039efc /Build/source/texk | |
parent | 73b30c64b734258fe06c255e9c3907bcd75afc94 (diff) |
tiny inner-loop optimization from DRF
git-svn-id: svn://tug.org/texlive/trunk@70150 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/web2c/ChangeLog | 11 | ||||
-rw-r--r-- | Build/source/texk/web2c/Makefile.in | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/am/eptex.am | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/euptexdir/am/euptex.am | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/locnull-optimize.ch | 34 | ||||
-rw-r--r-- | Build/source/texk/web2c/man/Makefile.in | 54 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/am/pdftex.am | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/am/ptex.am | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/am/uptex.am | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/am/xetex.am | 3 |
10 files changed, 90 insertions, 33 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog index c2d202632b9..49fdecc6175 100644 --- a/Build/source/texk/web2c/ChangeLog +++ b/Build/source/texk/web2c/ChangeLog @@ -1,3 +1,14 @@ +2024-02-25 Karl Berry <karl@freefriends.org> + + * locnull-optimize.ch: inner loop optimization (removing one + unnecessary condition) from DRF. + * eptexdir/am/eptex.am (eptex_web_srcs), + * euptexdir/am/euptex.am (euptex_web_srcs), + * pdftexdir/am/pdftex.am (pdftex_ch_srcs), + * ptexdir/am/ptex.am (ptex_web_srcs), + * uptexdir/am/uptex.am (uptex_web_srcs), + * xetexdir/am/xetex.am (xetex_ch_srcs): include locnull-optimize.ch. + 2024-02-20 Karl Berry <karl@tug.org> * doc/web2c.texi: 2024. diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in index 3715e1cd394..f05311dc2dc 100644 --- a/Build/source/texk/web2c/Makefile.in +++ b/Build/source/texk/web2c/Makefile.in @@ -4419,6 +4419,7 @@ ptex_web_srcs = \ tex.ch \ tracingstacklevels.ch \ partoken.ch \ + locnull-optimize.ch \ zlib-fmt.ch ptex_ch_srcs = \ @@ -4458,6 +4459,7 @@ eptex_web_srcs = \ tex.ch \ tracingstacklevels.ch \ partoken.ch \ + locnull-optimize.ch \ showstream.ch \ zlib-fmt.ch \ etexdir/tex.ech @@ -4509,6 +4511,7 @@ uptex_web_srcs = \ tex.ch \ tracingstacklevels.ch \ partoken.ch \ + locnull-optimize.ch \ zlib-fmt.ch uptex_ch_srcs = \ @@ -4579,6 +4582,7 @@ euptex_web_srcs = \ tex.ch \ tracingstacklevels.ch \ partoken.ch \ + locnull-optimize.ch \ showstream.ch \ zlib-fmt.ch \ etexdir/tex.ech @@ -4726,6 +4730,7 @@ pdftex_ch_srcs = \ tracingstacklevels.ch \ partoken-102.ch \ partoken.ch \ + locnull-optimize.ch \ showstream.ch \ zlib-fmt.ch \ enctexdir/enctex1.ch \ @@ -5426,6 +5431,7 @@ xetex_ch_srcs = \ tracingstacklevels.ch \ partoken-102.ch \ partoken.ch \ + locnull-optimize.ch \ showstream.ch \ $(xetex_ch_synctex) \ xetexdir/xetex.ch \ diff --git a/Build/source/texk/web2c/eptexdir/am/eptex.am b/Build/source/texk/web2c/eptexdir/am/eptex.am index fce0a5e31ad..6bb6e996d2a 100644 --- a/Build/source/texk/web2c/eptexdir/am/eptex.am +++ b/Build/source/texk/web2c/eptexdir/am/eptex.am @@ -1,7 +1,7 @@ ## $Id$ ## texk/web2c/eptexdir/am/eptex.am: Makefile fragment for e-pTeX. ## -## Copyright 2015-2022 Karl Berry <tex-live@tug.org> +## Copyright 2015-2024 Karl Berry <tex-live@tug.org> ## Copyright 2011-2015 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. @@ -59,6 +59,7 @@ eptex_web_srcs = \ tex.ch \ tracingstacklevels.ch \ partoken.ch \ + locnull-optimize.ch \ showstream.ch \ zlib-fmt.ch \ etexdir/tex.ech diff --git a/Build/source/texk/web2c/euptexdir/am/euptex.am b/Build/source/texk/web2c/euptexdir/am/euptex.am index 3ad8ab71525..31e31e04bb7 100644 --- a/Build/source/texk/web2c/euptexdir/am/euptex.am +++ b/Build/source/texk/web2c/euptexdir/am/euptex.am @@ -1,7 +1,7 @@ ## $Id$ ## texk/web2c/euptexdir/am/euptex.am: Makefile fragment for e-upTeX. ## -## Copyright 2015-2022 Karl Berry <tex-live@tug.org> +## Copyright 2015-2024 Karl Berry <tex-live@tug.org> ## Copyright 2011-2015 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. @@ -61,6 +61,7 @@ euptex_web_srcs = \ tex.ch \ tracingstacklevels.ch \ partoken.ch \ + locnull-optimize.ch \ showstream.ch \ zlib-fmt.ch \ etexdir/tex.ech diff --git a/Build/source/texk/web2c/locnull-optimize.ch b/Build/source/texk/web2c/locnull-optimize.ch new file mode 100644 index 00000000000..7c01a5085cf --- /dev/null +++ b/Build/source/texk/web2c/locnull-optimize.ch @@ -0,0 +1,34 @@ +% $Id$ +% (public domain) +% +% Date: Wed, 21 Feb 2024 21:32:57 +0000 (UTC) +% From: David Fuchs <drfuchs@yahoo.com> +% To: Karl Berry <karl@freefriends.org> +% Subject: Missed optimization in TeX: |loc=null| implies |state=token_list| +% +% The final comment in <Recover from an unbalanced output routine> +% explicitly notes that |null=min_halfword<=0|, and it assumes we +% also know that during file input, |loc| can only be as small as +% the initial value of |first|, which is 1. So |loc| +% is strictly larger than |null| during file input (i.e. when +% |state<>token_list|). +% +% So, |loc=null| implies |state=token_list|. +% Thus, |(state=token_list)and(loc=null) = (loc=null)| always. +% +% Ergo, we can simplify two statements in TeX (two cases of "conserve +% stack space", the first of which is inner-loop; might save a whole cycle). +% +% In |back_input|: +@x [23.325] l.7025 +begin while (state=token_list)and(loc=null)and(token_type<>v_template) do +@y +begin while (loc=null)and(token_type<>v_template) do +@z + +% In <Feed the macro body and its parameters to the scanner>: +@x [25.390] l.7983 +while (state=token_list)and(loc=null)and(token_type<>v_template) do +@y +while (loc=null)and(token_type<>v_template) do +@z diff --git a/Build/source/texk/web2c/man/Makefile.in b/Build/source/texk/web2c/man/Makefile.in index 193137c1e64..ed8f6da1052 100644 --- a/Build/source/texk/web2c/man/Makefile.in +++ b/Build/source/texk/web2c/man/Makefile.in @@ -88,28 +88,29 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WEB_TRUE@am__append_1 = $(web_man_sources) -@TEX_TRUE@am__append_2 = tex.man -@TEX_TRUE@am__append_3 = tex:initex -@MF_TRUE@am__append_4 = mf.man -@MF_TRUE@am__append_5 = mf:inimf -@MFN_TRUE@@MF_TRUE@am__append_6 = mf:mf-nowin -@MP_TRUE@am__append_7 = mpost.man -@ETEX_TRUE@am__append_8 = etex.man -@PDFTEX_TRUE@am__append_9 = $(pdftex_man_sources) -@PDFTEX_TRUE@am__append_10 = pdftex:pdflatex -@EPTEX_TRUE@am__append_11 = ptex.man ppltotf.man ptftopl.man \ +@WEB_TRUE@am__append_2 = twill:twill-refsort +@TEX_TRUE@am__append_3 = tex.man +@TEX_TRUE@am__append_4 = tex:initex +@MF_TRUE@am__append_5 = mf.man +@MF_TRUE@am__append_6 = mf:inimf +@MFN_TRUE@@MF_TRUE@am__append_7 = mf:mf-nowin +@MP_TRUE@am__append_8 = mpost.man +@ETEX_TRUE@am__append_9 = etex.man +@PDFTEX_TRUE@am__append_10 = $(pdftex_man_sources) +@PDFTEX_TRUE@am__append_11 = pdftex:pdflatex +@EPTEX_TRUE@am__append_12 = ptex.man ppltotf.man ptftopl.man \ @EPTEX_TRUE@ pbibtex.man -@EPTEX_TRUE@am__append_12 = ptex:eptex ptex:euptex ptex:uptex \ +@EPTEX_TRUE@am__append_13 = ptex:eptex ptex:euptex ptex:uptex \ @EPTEX_TRUE@ ppltotf:uppltotf ptftopl:uptftopl pbibtex:upbibtex -@LUATEX_TRUE@am__append_13 = luatex.man -@LUATEX_TRUE@am__append_14 = luatex:texlua luatex:texluac \ +@LUATEX_TRUE@am__append_14 = luatex.man +@LUATEX_TRUE@am__append_15 = luatex:texlua luatex:texluac \ @LUATEX_TRUE@ luatex:luahbtex luatex:luajittex \ @LUATEX_TRUE@ luatex:dviluatex -@XETEX_TRUE@am__append_15 = xetex.man -@OTANGLE_TRUE@am__append_16 = $(otangle_man_sources) -@OTANGLE_TRUE@am__append_17 = dvicopy:odvicopy dvitype:odvitype tangle:otangle -@ALEPH_TRUE@am__append_18 = aleph.man +@XETEX_TRUE@am__append_16 = xetex.man +@OTANGLE_TRUE@am__append_17 = $(otangle_man_sources) +@OTANGLE_TRUE@am__append_18 = dvicopy:odvicopy dvitype:odvitype tangle:otangle +@ALEPH_TRUE@am__append_19 = aleph.man subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ @@ -456,10 +457,10 @@ top_srcdir = @top_srcdir@ wlibs = @wlibs@ x_ext_lib = @x_ext_lib@ x_tool_libs = @x_tool_libs@ -man_sources = $(bootstrap_man_sources) $(am__append_1) $(am__append_2) \ - $(am__append_4) $(am__append_7) $(am__append_8) \ - $(am__append_9) $(am__append_11) $(am__append_13) \ - $(am__append_15) $(am__append_16) $(am__append_18) \ +man_sources = $(bootstrap_man_sources) $(am__append_1) $(am__append_3) \ + $(am__append_5) $(am__append_8) $(am__append_9) \ + $(am__append_10) $(am__append_12) $(am__append_14) \ + $(am__append_16) $(am__append_17) $(am__append_19) \ $(misc_man_sources) EXTRA_DIST = $(bootstrap_man_sources) $(web_man_sources) tex.man \ mf.man mpost.man etex.man $(pdftex_man_sources) ptex.man \ @@ -468,12 +469,11 @@ EXTRA_DIST = $(bootstrap_man_sources) $(web_man_sources) tex.man \ bootstrap_man_sources = ctie.man cweb.man ctwill.man tangle.man tie.man # Symlinks within $(man1dir): FILE:LINK indicates LINK.1->FILE.1 -man1_links = cweb:ctangle cweb:cweave \ - ctwill:ctwill-proofsort ctwill:ctwill-refsort \ - ctwill:ctwill-twinx twill:twill-refsort $(am__append_3) \ - $(am__append_5) $(am__append_6) $(am__append_10) \ - $(am__append_12) $(am__append_14) $(am__append_17) \ - latex-dev:pdflatex-dev latex-dev:xelatex-dev \ +man1_links = cweb:ctangle cweb:cweave ctwill:ctwill-proofsort \ + ctwill:ctwill-refsort ctwill:ctwill-twinx $(am__append_2) \ + $(am__append_4) $(am__append_6) $(am__append_7) \ + $(am__append_11) $(am__append_13) $(am__append_15) \ + $(am__append_18) latex-dev:pdflatex-dev latex-dev:xelatex-dev \ latex-dev:lualatex-dev latex-dev:dvilualatex-dev \ latex-dev:platex-dev latex-dev:uplatex-dev web_man_sources = bibtex.man dvicopy.man dvitomp.man dvitype.man gftodvi.man \ diff --git a/Build/source/texk/web2c/pdftexdir/am/pdftex.am b/Build/source/texk/web2c/pdftexdir/am/pdftex.am index ac081b952de..a5b16acc5c4 100644 --- a/Build/source/texk/web2c/pdftexdir/am/pdftex.am +++ b/Build/source/texk/web2c/pdftexdir/am/pdftex.am @@ -1,7 +1,7 @@ ## $Id$ ## texk/web2c/pdftexdir/am/pdftex.am: Makefile fragment for pdfTeX. ## -## Copyright 2016-2022 Karl Berry <tex-live@tug.org> +## Copyright 2016-2024 Karl Berry <tex-live@tug.org> ## Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. @@ -73,6 +73,7 @@ pdftex_ch_srcs = \ tracingstacklevels.ch \ partoken-102.ch \ partoken.ch \ + locnull-optimize.ch \ showstream.ch \ zlib-fmt.ch \ enctexdir/enctex1.ch \ diff --git a/Build/source/texk/web2c/ptexdir/am/ptex.am b/Build/source/texk/web2c/ptexdir/am/ptex.am index 663b9c17cf7..afda7181fba 100644 --- a/Build/source/texk/web2c/ptexdir/am/ptex.am +++ b/Build/source/texk/web2c/ptexdir/am/ptex.am @@ -1,7 +1,7 @@ ## $Id$ ## texk/web2c/ptexdir/am/ptex.am: Makefile fragment for pTeX. ## -## Copyright 2015-2022 Karl Berry <tex-live@tug.org> +## Copyright 2015-2024 Karl Berry <tex-live@tug.org> ## Copyright 2010-2015 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. @@ -76,6 +76,7 @@ ptex_web_srcs = \ tex.ch \ tracingstacklevels.ch \ partoken.ch \ + locnull-optimize.ch \ zlib-fmt.ch # Generate ptex.ch diff --git a/Build/source/texk/web2c/uptexdir/am/uptex.am b/Build/source/texk/web2c/uptexdir/am/uptex.am index ddb486edd4b..8264e41d964 100644 --- a/Build/source/texk/web2c/uptexdir/am/uptex.am +++ b/Build/source/texk/web2c/uptexdir/am/uptex.am @@ -1,7 +1,7 @@ ## $Id$ ## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX. ## -## Copyright 2016-2023 Karl Berry <tex-live@tug.org> +## Copyright 2016-2024 Karl Berry <tex-live@tug.org> ## Copyright 2011-2015 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. @@ -70,6 +70,7 @@ uptex_web_srcs = \ tex.ch \ tracingstacklevels.ch \ partoken.ch \ + locnull-optimize.ch \ zlib-fmt.ch # Generate uptex.ch diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am index dec7b04e9b4..59f2b8285a7 100644 --- a/Build/source/texk/web2c/xetexdir/am/xetex.am +++ b/Build/source/texk/web2c/xetexdir/am/xetex.am @@ -1,7 +1,7 @@ ## $Id$ ## texk/web2c/xetexdir/am/xetex.am: Makefile fragment for XeTeX. ## -## Copyright 2017-2022 Karl Berry <tex-live@tug.org> +## Copyright 2017-2024 Karl Berry <tex-live@tug.org> ## Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. @@ -116,6 +116,7 @@ xetex_ch_srcs = \ tracingstacklevels.ch \ partoken-102.ch \ partoken.ch \ + locnull-optimize.ch \ showstream.ch \ $(xetex_ch_synctex) \ xetexdir/xetex.ch \ |