Compiler performance with my ridiculous Binderoo code

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 12 17:52:01 PST 2016


On Sunday, 11 December 2016 at 22:48:56 UTC, Chris Wright wrote:
> On Sun, 11 Dec 2016 18:08:04 +0000, safety0ff wrote:
>> [...]
>
> That's one option. Here's another:
>
> Template instantiations are interned as they are constructed 
> (or at least should be). You must construct their arguments 
> before you instantiate the template. Therefore you can do a 
> reference equality check instead of checking the values of the 
> parameters.
>
> [...]

Collisions are not the problem.
In the worst case they add a linear factor.

If you truly get the interning right, it will reduce the 
complexity from O(n!) to O(n^2.6)
However it will pessimize the  overall performance of everything 
that are not deeply recursive templates.


More information about the Digitalmars-d mailing list