texlive[70150] Build/source/texk/web2c: tiny inner-loop optimization

commits+karl at tug.org commits+karl at tug.org
Sun Feb 25 18:08:16 CET 2024


Revision: 70150
          https://tug.org/svn/texlive?view=revision&revision=70150
Author:   karl
Date:     2024-02-25 18:08:15 +0100 (Sun, 25 Feb 2024)
Log Message:
-----------
tiny inner-loop optimization from DRF

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/Makefile.in
    trunk/Build/source/texk/web2c/eptexdir/am/eptex.am
    trunk/Build/source/texk/web2c/euptexdir/am/euptex.am
    trunk/Build/source/texk/web2c/man/Makefile.in
    trunk/Build/source/texk/web2c/pdftexdir/am/pdftex.am
    trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
    trunk/Build/source/texk/web2c/uptexdir/am/uptex.am
    trunk/Build/source/texk/web2c/xetexdir/am/xetex.am

Added Paths:
-----------
    trunk/Build/source/texk/web2c/locnull-optimize.ch

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/ChangeLog	2024-02-25 17:08:15 UTC (rev 70150)
@@ -1,3 +1,14 @@
+2024-02-25  Karl Berry  <karl at 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 at tug.org>
 
 	* doc/web2c.texi: 2024.

Modified: trunk/Build/source/texk/web2c/Makefile.in
===================================================================
--- trunk/Build/source/texk/web2c/Makefile.in	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/Makefile.in	2024-02-25 17:08:15 UTC (rev 70150)
@@ -4419,6 +4419,7 @@
 	tex.ch \
 	tracingstacklevels.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	zlib-fmt.ch
 
 ptex_ch_srcs = \
@@ -4458,6 +4459,7 @@
 	tex.ch \
 	tracingstacklevels.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	showstream.ch \
 	zlib-fmt.ch \
 	etexdir/tex.ech
@@ -4509,6 +4511,7 @@
 	tex.ch \
 	tracingstacklevels.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	zlib-fmt.ch
 
 uptex_ch_srcs = \
@@ -4579,6 +4582,7 @@
 	tex.ch \
 	tracingstacklevels.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	showstream.ch \
 	zlib-fmt.ch \
 	etexdir/tex.ech
@@ -4726,6 +4730,7 @@
 	tracingstacklevels.ch \
 	partoken-102.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	showstream.ch \
 	zlib-fmt.ch \
 	enctexdir/enctex1.ch \
@@ -5426,6 +5431,7 @@
 	tracingstacklevels.ch \
 	partoken-102.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	showstream.ch \
 	$(xetex_ch_synctex) \
 	xetexdir/xetex.ch \

Modified: trunk/Build/source/texk/web2c/eptexdir/am/eptex.am
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/am/eptex.am	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/eptexdir/am/eptex.am	2024-02-25 17:08:15 UTC (rev 70150)
@@ -1,7 +1,7 @@
 ## $Id$
 ## texk/web2c/eptexdir/am/eptex.am: Makefile fragment for e-pTeX.
 ##
-## Copyright 2015-2022 Karl Berry <tex-live at tug.org>
+## Copyright 2015-2024 Karl Berry <tex-live at tug.org>
 ## Copyright 2011-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
@@ -59,6 +59,7 @@
 	tex.ch \
 	tracingstacklevels.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	showstream.ch \
 	zlib-fmt.ch \
 	etexdir/tex.ech

Modified: trunk/Build/source/texk/web2c/euptexdir/am/euptex.am
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/am/euptex.am	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/euptexdir/am/euptex.am	2024-02-25 17:08:15 UTC (rev 70150)
@@ -1,7 +1,7 @@
 ## $Id$
 ## texk/web2c/euptexdir/am/euptex.am: Makefile fragment for e-upTeX.
 ##
-## Copyright 2015-2022 Karl Berry <tex-live at tug.org>
+## Copyright 2015-2024 Karl Berry <tex-live at tug.org>
 ## Copyright 2011-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
@@ -61,6 +61,7 @@
 	tex.ch \
 	tracingstacklevels.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	showstream.ch \
 	zlib-fmt.ch \
 	etexdir/tex.ech

Added: trunk/Build/source/texk/web2c/locnull-optimize.ch
===================================================================
--- trunk/Build/source/texk/web2c/locnull-optimize.ch	                        (rev 0)
+++ trunk/Build/source/texk/web2c/locnull-optimize.ch	2024-02-25 17:08:15 UTC (rev 70150)
@@ -0,0 +1,34 @@
+% $Id$
+% (public domain)
+% 
+% Date: Wed, 21 Feb 2024 21:32:57 +0000 (UTC)
+% From: David Fuchs <drfuchs at yahoo.com>
+% To: Karl Berry <karl at 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|:
+ at x [23.325] l.7025
+begin while (state=token_list)and(loc=null)and(token_type<>v_template) do
+ at y
+begin while (loc=null)and(token_type<>v_template) do
+ at z
+
+% In <Feed the macro body and its parameters to the scanner>:
+ at x [25.390] l.7983
+while (state=token_list)and(loc=null)and(token_type<>v_template) do
+ at y
+while (loc=null)and(token_type<>v_template) do
+ at z


Property changes on: trunk/Build/source/texk/web2c/locnull-optimize.ch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/man/Makefile.in
===================================================================
--- trunk/Build/source/texk/web2c/man/Makefile.in	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/man/Makefile.in	2024-02-25 17:08:15 UTC (rev 70150)
@@ -88,28 +88,29 @@
 build_triplet = @build@
 host_triplet = @host@
 @WEB_TRUE at am__append_1 = $(web_man_sources)
- at TEX_TRUE@am__append_2 = tex.man
- at TEX_TRUE@am__append_3 = tex:initex
- at MF_TRUE@am__append_4 = mf.man
- at MF_TRUE@am__append_5 = mf:inimf
- at MFN_TRUE@@MF_TRUE at am__append_6 = mf:mf-nowin
- at MP_TRUE@am__append_7 = mpost.man
- at ETEX_TRUE@am__append_8 = etex.man
- at PDFTEX_TRUE@am__append_9 = $(pdftex_man_sources)
- at PDFTEX_TRUE@am__append_10 = pdftex:pdflatex
- at EPTEX_TRUE@am__append_11 = ptex.man ppltotf.man ptftopl.man \
+ at WEB_TRUE@am__append_2 = twill:twill-refsort
+ at TEX_TRUE@am__append_3 = tex.man
+ at TEX_TRUE@am__append_4 = tex:initex
+ at MF_TRUE@am__append_5 = mf.man
+ at MF_TRUE@am__append_6 = mf:inimf
+ at MFN_TRUE@@MF_TRUE at am__append_7 = mf:mf-nowin
+ at MP_TRUE@am__append_8 = mpost.man
+ at ETEX_TRUE@am__append_9 = etex.man
+ at PDFTEX_TRUE@am__append_10 = $(pdftex_man_sources)
+ at PDFTEX_TRUE@am__append_11 = pdftex:pdflatex
+ at EPTEX_TRUE@am__append_12 = ptex.man ppltotf.man ptftopl.man \
 @EPTEX_TRUE@	pbibtex.man
- at EPTEX_TRUE@am__append_12 = ptex:eptex ptex:euptex ptex:uptex \
+ at EPTEX_TRUE@am__append_13 = ptex:eptex ptex:euptex ptex:uptex \
 @EPTEX_TRUE@	ppltotf:uppltotf ptftopl:uptftopl pbibtex:upbibtex
- at LUATEX_TRUE@am__append_13 = luatex.man
- at LUATEX_TRUE@am__append_14 = luatex:texlua luatex:texluac \
+ at LUATEX_TRUE@am__append_14 = luatex.man
+ at LUATEX_TRUE@am__append_15 = luatex:texlua luatex:texluac \
 @LUATEX_TRUE@  luatex:luahbtex luatex:luajittex \
 @LUATEX_TRUE@  luatex:dviluatex
 
- at XETEX_TRUE@am__append_15 = xetex.man
- at OTANGLE_TRUE@am__append_16 = $(otangle_man_sources)
- at OTANGLE_TRUE@am__append_17 = dvicopy:odvicopy dvitype:odvitype tangle:otangle
- at ALEPH_TRUE@am__append_18 = aleph.man
+ at XETEX_TRUE@am__append_16 = xetex.man
+ at OTANGLE_TRUE@am__append_17 = $(otangle_man_sources)
+ at OTANGLE_TRUE@am__append_18 = dvicopy:odvicopy dvitype:odvitype tangle:otangle
+ at 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 @@
 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 @@
 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 \

Modified: trunk/Build/source/texk/web2c/pdftexdir/am/pdftex.am
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/am/pdftex.am	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/pdftexdir/am/pdftex.am	2024-02-25 17:08:15 UTC (rev 70150)
@@ -1,7 +1,7 @@
 ## $Id$
 ## texk/web2c/pdftexdir/am/pdftex.am: Makefile fragment for pdfTeX.
 ##
-## Copyright 2016-2022 Karl Berry <tex-live at tug.org>
+## Copyright 2016-2024 Karl Berry <tex-live at tug.org>
 ## Copyright 2009-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
@@ -73,6 +73,7 @@
 	tracingstacklevels.ch \
 	partoken-102.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	showstream.ch \
 	zlib-fmt.ch \
 	enctexdir/enctex1.ch \

Modified: trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/am/ptex.am	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/ptexdir/am/ptex.am	2024-02-25 17:08:15 UTC (rev 70150)
@@ -1,7 +1,7 @@
 ## $Id$
 ## texk/web2c/ptexdir/am/ptex.am: Makefile fragment for pTeX.
 ##
-## Copyright 2015-2022 Karl Berry <tex-live at tug.org>
+## Copyright 2015-2024 Karl Berry <tex-live at tug.org>
 ## Copyright 2010-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
@@ -76,6 +76,7 @@
 	tex.ch \
 	tracingstacklevels.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	zlib-fmt.ch
 
 # Generate ptex.ch

Modified: trunk/Build/source/texk/web2c/uptexdir/am/uptex.am
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/am/uptex.am	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/uptexdir/am/uptex.am	2024-02-25 17:08:15 UTC (rev 70150)
@@ -1,7 +1,7 @@
 ## $Id$
 ## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX.
 ##
-## Copyright 2016-2023 Karl Berry <tex-live at tug.org>
+## Copyright 2016-2024 Karl Berry <tex-live at tug.org>
 ## Copyright 2011-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
@@ -70,6 +70,7 @@
 	tex.ch \
 	tracingstacklevels.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	zlib-fmt.ch
 
 # Generate uptex.ch

Modified: trunk/Build/source/texk/web2c/xetexdir/am/xetex.am
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/am/xetex.am	2024-02-25 16:24:18 UTC (rev 70149)
+++ trunk/Build/source/texk/web2c/xetexdir/am/xetex.am	2024-02-25 17:08:15 UTC (rev 70150)
@@ -1,7 +1,7 @@
 ## $Id$
 ## texk/web2c/xetexdir/am/xetex.am: Makefile fragment for XeTeX.
 ##
-## Copyright 2017-2022 Karl Berry <tex-live at tug.org>
+## Copyright 2017-2024 Karl Berry <tex-live at tug.org>
 ## Copyright 2009-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
@@ -116,6 +116,7 @@
 	tracingstacklevels.ch \
 	partoken-102.ch \
 	partoken.ch \
+	locnull-optimize.ch \
 	showstream.ch \
 	$(xetex_ch_synctex) \
 	xetexdir/xetex.ch \



More information about the tex-live-commits mailing list.