<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 31 Aug 2024 at 15:17, user202729--- via luatex <<a href="mailto:luatex@tug.org">luatex@tug.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Do you think the following is a reasonable possible performance improvement for LuaTeX? Thank you.<br>
<br>
------<br>
<br>
In the hnj_hyphenation function, currently the large array `utf8word` is zeroed out every time the function is called.<br>
<br>
This is unnecessary (the string is always null-terminated before being used. Besides, observe that the function processes multiple words per call, without zeroing out the array between each word, so even with the current function there could be nonzero bytes after the null terminator at each use of the array).<br>
<br>
For a plain TeX file where macro expansion takes negligible time (such as tex.tex, the source code of TeX), this single improvement can speeds up the compilation time by 25%. On my machine, the runtime decreases from 3.064s to 2.327s.<br>
<br>
To generate `tex.tex`, you can download `tex.web` from CTAN package `tex`, and run `weave tex.web`<br>
<br>
The patch is attached below.</blockquote><div><br></div><div>Thank you very much, surely Hans or me will check it asap. </div><div><br></div><div>--</div><div>luigi</div><div><br></div></div></div>