<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 1/13/22 16:33, Nikolay Nikolov
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:436a7317-8732-b321-640f-e128bca459b3@gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p><br>
</p>
<div class="moz-cite-prefix">On 1/13/22 10:58, Ben Grasset via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAL4d7FhucuEDFNkhQQVaQrf1AhC-X3+3dSer0sg-ZD80-YBCCw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<p>On Thu, Jan 13, 2022 at 1:58 AM Nikolay Nikolov via
fpc-devel <<a
href="mailto:fpc-devel@lists.freepascal.org"
moz-do-not-send="true" class="moz-txt-link-freetext">fpc-devel@lists.freepascal.org</a>>
wrote:</p>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>
<p> I haven't tested in Windows, but it would be very
strange and suspicious if the results are very
different.</p>
</div>
</blockquote>
<div> </div>
<div>It would be neither of those things. The exception
handling on x64 Windows is the fastest provided by FPC,
for example (though the compiler AFAIK avoids doing
anything that would generate exception handling code
within its own codebase as much as possible).</div>
</div>
</div>
</blockquote>
<p>So, instead of giving actual benchmark data on the Windows
performance, you speculate by claiming that having faster
exception handling matters, and then you immediately debunk your
own argument by admitting it probably doesn't matter for the
compilation speed. Sure, using SSE2 is also faster, but it
doesn't matter for the compilation speed at all, because all the
performance critical parts are integer code, therefore it would
be silly to give this as an argument as well. Sometimes 64-bit
is faster (due to SSE2, AVX, exception handling, having more
registers), sometimes 32-bit is faster (pointers are half the
size, leading to less memory use, leading to less memory
bandwidth requirements and more data fitting in the processor
caches). Which is faster must always be determined by running
some sort of benchmark, not by theoretical speculation. Rule
number 1 of optimization is "never assume".</p>
</blockquote>
<p>Ok, I did some testing in Windows 10 21H2 and the 32-bit
crosscompiler was faster. I tested compiling lazarus for win64
from lazarus git, using FPC 3.2.2. The crosscompiler is the one
that we ship, the native compiler is the one that is shipped with
lazarus 2.2.0 for win64. I did not use multithreaded compilation,
because "make -j24" didn't work with lazarus. Maybe the lazarus
makefiles don't support that and I should use lazbuild, but I
don't know how. I tested "make all", not "make bigide". Both the
FPC 3.2.2 crosscompiler and the native compiler were on an SSD, on
an NTFS filesystem, with NTFS compression enabled. The lazarus
sources that I compiled were on a HDD (no space on my windows SSD
partition, sorry), but I have 128GB RAM, most of which are free
and used by Windows as cache. I did several runs and discarded the
first result, to avoid the effect of HDD files not being in the
cache. Before each run, I cleaned up with right
click->TortoiseGit->Clean up...->Clean Type = "Remove all
untracked files (-fx)"; + "Remove untracked directories (-d)".
This was followed by emptying the recycle bin. I have the default
Microsoft antivirus program Windows Defender installed and fully
updated. I tested both with antivirus real-time protection enabled
and disabled. All measurements were made using "Measure-Command"
in PowerShell. Here are the best results for each case:</p>
<p>antivirus off:</p>
<p>ppcrossx64: 83.8517351 seconds</p>
<p>ppcx64: 85.0845576 seconds</p>
<p>with antivirus on there's a huge variance of speeds:</p>
<p>ppcrossx64: 90.3048706 seconds - 95.4332713 seconds<br>
</p>
<p>ppcx64: 86.8207751 seconds - 99.2315772 seconds.</p>
<p>There were some ppcx64 runs that were slightly faster with
antivirus on, but there were also slower and they didn't converge
to a single value after several runs, but retained their random
variance. But with the antivirus off, the crosscompiler was
clearly faster.</p>
<p>Any suggestions for testing multithreaded compilation of lazarus
are welcome. I'll be happy to test that as well.<br>
</p>
<p>Nikolay</p>
</body>
</html>