Divide & Conquer divides, but doesn't conquer

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 25 18:33:13 UTC 2020


On 5/25/20 12:07 PM, Stefan Koch wrote:
> On Monday, 25 May 2020 at 16:04:24 UTC, Andrei Alexandrescu wrote:
>> On 5/25/20 3:15 AM, Max Samukha wrote:
>>> On Monday, 25 May 2020 at 06:18:13 UTC, FeepingCreature wrote:
>>>
>>>> static foreach and stringof were used so I didn't have to pull in 
>>>> `format` or `to!string`, which had issues in std.meta.
>>>>
>>>> I'm seeing some improvement over 2.086 at least; it should be about 
>>>> equivalent to the hand-unrolled version in master.
>>>
>>> How could you miss the state-of-the-art?) Preallocate the result 
>>> string and use the string counter hack!
>>> http://dpldocs.info/this-week-in-d/Blog.Posted_2020_05_11.html#dmd-and-static-foreach 
>>>
>>
>> static foreach is quadratic? Is this a matter of principle, or QoI?
> 
> Yes it is.
> I did present this fact at the pre-event to Dconf 2018.
> 
> As for your other question it's both. The QoI is not stellar.
> But it is fundamentally limited by having to create independent scopes.

How do you mean that? static foreach does not create a scope.



More information about the Digitalmars-d mailing list