jfbu / texdimens

Utilities and documentation related to TeX dimensional units
1 stars 0 forks source link

Maybe check if removing one `\relax` which is not mandated by expression syntax brings some gain #29

Closed jfbu closed 1 year ago

jfbu commented 1 year ago

In the code for the bp, dd, and nd unit such as https://github.com/jfbu/texdimens/blob/266b4c2de0d69c1122162dc3f2997277a8ffee4a/texdimens/texdimens.tex#L217-L222

the \relax\relax could be a single \relax. I don't remember why I used two, except that I like to not rely on e-TeX rules for terminations of expression apart from the \relax-one. So perhaps (and now that I added benchmark file, this is only a matter of doing it), try out with a single \relax and see it if it brings any gain.

By the way there are other instances of \relax\relax in the code but those can't be reduced to a single \relax.

jfbu commented 1 year ago

I checked (or rather tried to), and it does seem \relax\relax is the better choice (see commit message https://github.com/jfbu/texdimens/commit/953e7795f566e924c3d9a09a18eb94ca9883eb08). The effect, if any, when trying to isolate it as done in file benchmarknumexpr.tex, appears to be of the order of one percent, and is thus quite less than that in the real thing.

Closing as completed.