Success! Find is slow no more

Jon Degenhardt jond at noreply.com
Thu May 23 00:42:12 UTC 2019


On Thursday, 23 May 2019 at 00:16:16 UTC, H. S. Teoh wrote:
> On Wed, May 22, 2019 at 11:52:12PM +0000, Brian Schott via 
> Digitalmars-d wrote:
>> On Wednesday, 22 May 2019 at 23:24:47 UTC, H. S. Teoh wrote:
>> > But if your code shows improvement with ldc/gdc, *then* we 
>> > have something interesting to talk about.
>> 
>> Cloning the repository and running "make ldc" on my machine 
>> gives the following:
>> 
>> Search in Alice in Wonderland
>>        std: 178 ±13
>>     manual: 124 ±10
>>   A2Phobos: 100 ±0
>>      Chris: 121 ±10
>>     Andrei: 172 ±11
>>    Andrei2: 116 ±8
>>     Faster: 143 ±10
> [...]
>
> Interesting! So A2Phobos (which version does it refer to?) is 
> faster in all these cases. Looks like that's what we should 
> merge. The `Faster` algorithm doesn't seem to do very well, I'm 
> guessing because the manual optimizations have confused LDC's 
> optimizer enough that it's unable to produce good code.
>
>
> T

Should also benchmark with LTO turned on (including LTO for 
Phobos/DRuntime). This doesn't always help, but it does in a 
number of cases, and it's difficult to predict without trying. 
I've had especially good results when tight loops are involved. 
For LDC add  '-flto=thin 
-defaultlib=phobos2-ldc-lto,druntime-ldc-lto' to the build line.

(LTO+PGO is even more likely to be beneficial, but PGO takes more 
investment than LTO).

--Jon



More information about the Digitalmars-d mailing list