Divide & Conquer divides, but doesn't conquer

Stefan Koch uplink.coder at googlemail.com
Mon May 25 15:59:43 UTC 2020


On Monday, 25 May 2020 at 05:55:07 UTC, Walter Bright wrote:
> On 5/24/2020 8:19 PM, Adam D. Ruppe wrote:
>> I ran a test to compare the two implementations. First was 
>> comparing 10,000 references to the same instance.
>
> Thank you. This is good information. I'm curious how the new 
> staticMap compares:
>
> https://github.com/dlang/phobos/pull/7490

This has brought down the compile time of my test indeed.
Almost but not quite down to `...`

Let me post my test.

I measured that for my test your staticMap is 1.2x faster than 
the regular the version before the pull.

--
   './dmd.sh sm.d -c -version=Walter' ran
     1.21 ± 0.10 times faster than './dmd.sh sm.d -c'
--


I measured that our `...` is about 1.5x faster than  than your 
improved staticMap

--
   './dmd.sh sm.d -c -version=DotDotDot' ran
     1.49 ± 0.18 times faster than './dmd.sh sm.d -c 
-version=Walter'
--

Which should make our version about 2 times faster than the 
baseline
and indeed

--
   './dmd.sh sm.d -c -version=DotDotDot' ran
     2.05 ± 0.23 times faster than './dmd.sh sm.d -c'
--



The source used file used for the benchmark is here:
https://gist.github.com/UplinkCoder/9772f27cf088f08901b44fb57935aaaf

The dmd used is at commit 2f23e3348e9a927c025637a4852d4d77beb997d3
which is on manu's fork of the compiler.


More information about the Digitalmars-d mailing list