December 13, 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.
January 02, 2017
On Sunday, 11 December 2016 at 19:40:21 UTC, safety0ff wrote:
> On Sunday, 11 December 2016 at 19:00:23 UTC, Stefan Koch wrote:
>>
>> Just use this little program to simulate the process.
>
> That's not really useful for understanding and making progress on the issue.
>
> I had a patch with improved hash functions which I stashed away since it seemed the mangle approach would be the way forward.
> I also have no test code to benchmark it either (i.e. the degenerate case I was asking for.)

Try static immutable x = aliasSeqOf!(iota(4000))
1 2
Next ›   Last »