[tex-live] strange discrepancy in running time of etex between TL2015 and TL2017

jfbu jfbu at free.fr
Wed Jul 26 22:00:30 CEST 2017


I am ready to upload xint 1.2l to CTAN tonight, and although
I didn't expect much changes (this is mainly a maintenance
release), as part of my release routine
I ran some code from the user manual about pi via Machin formula
to compare execution time with 1.2k version. (I expected no big
change because I did not much modify the code base)

Let me point out that the matter here is not the code itself,
which is surely much improvable upon, for example by dropping
TeX altogether. I am just saying that to preventively dispel some
misinterpretations. I know how to improve the speed by a factor
5000 at least, if I really want.

I just take it as a benchmark test.

Procedure to follow:

1. grab xint.dtx from CTAN (currently 1.2k, in 2 or 3 days will be 1.2l)


2. execute "etex xint.dtx" in some work repertory

Then you have all xint.sty etc.. files extracted

3. run in this work repertory the test file which I will indicate next via

"time etex testmachin.tex"

- with TL2017

- with TL2015

4. compare the timing result. On my Mac OS 10.9.5 I consistently get
on an iMac about 5 years old, around

- 6.5 seconds with TL2017 

- 4.5 seconds with TL2015

(the to-be-uploaded 1.2l seems to be about 5% faster than 1.2k
on this test, but this is not the point here)

Now I have no idea why 4.5 seconds with TL2015 and 6.5 seconds with TL2017 !

This is, as explained above, with the exact same xint version.

xint has no dependencies on other macro packages. The only different
thing is the etex (pdfetex) binary.

Here is now the benchmark file, it is extracted from the user manual basically
(The user manual contains a much faster other algorithm for pi too. Just to
help dispel preventively some misinterpretations) 

% save this as testmachin.tex
% Compile with e-TeX extensions enabled (etex, pdftex, ...)
\input xintfrac.sty
\input xintseries.sty
% pi = 16 Arctg(1/5) - 4 Arctg(1/239) (John Machin's formula)
\def\coeffarctg #1{\the\numexpr\ifodd#1 -1\else1\fi\relax/%
                                       \the\numexpr 2*#1+1\relax [0]}%
\def\xa {1/25[0]}%
\def\xb {1/57121[0]}%
\def\Machin #1{%
    \romannumeral0\expandafter\MachinA \expandafter
    {\the\numexpr (#1+3)*5/7\expandafter}\expandafter
    {\the\numexpr (#1+3)*10/45\expandafter}\expandafter
    {\the\numexpr #1+3\expandafter}\expandafter
    {\the\numexpr #1\relax }}%
\def\MachinA #1#2#3#4%
{\xinttrunc {#4}
  {\xintMul {16/5}{\xintFxPtPowerSeries {0}{#1}{\coeffarctg}{\xa}{#3}}}
  {\xintMul {4/239}{\xintFxPtPowerSeries {0}{#2}{\coeffarctg}{\xb}{#3}}}%
\fdef\Z {\Machin {1000}}
\odef\W {\the\pdfelapsedtime}
\message{computed in \xintRound {2}{\W/65536} seconds.}


\ifx\x\Z \message{OK}\else \ERROR\fi

As I don't trust enormously \pdfelapsedtime, I double check via the unix "time",
hence the "time etex testmachin.tex"

Let me repeat the question is not about xint from TL2015 versus xint from TL2017

We are testing here the very same xint. At my side, the development version
which I will upload later tonight. At your side currently the 1.2k version.

The only difference is in the pdfetex.

Now the timing difference appears very significative.

I take the liberty to alert you upon this because I initially could not understand
the former timings I had recorded as comments in my copy of the file, 

this discrepancy is causing alarm on unsuspecting software developers and perhaps
someone will have an explanation

Perhaps my OS is relevant ? Mac OS X 10.9.5. This means that with 
TL2017 I use the so-called darwinlegacy executable.

(because I have not had the time to compile myself the binaries).

I would appreciate if you could CC to my mail address
as I don't subscribe to the list.

My bet is that people not on darwinlegacy will not reproduce my findings.



More information about the tex-live mailing list