Re: Compiler performance with my ridiculous Binderoo code

2017-01-02 Thread Stefan Koch via Digitalmars-d
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

Re: Compiler performance with my ridiculous Binderoo code

2016-12-12 Thread Stefan Koch via Digitalmars-d
On Sunday, 11 December 2016 at 22:48:56 UTC, Chris Wright wrote: On Sun, 11 Dec 2016 18:08:04 +, 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

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread Chris Wright via Digitalmars-d
On Sun, 11 Dec 2016 18:08:04 +, safety0ff wrote: > However, I understand the quadratic nature of comparing: > AliasSeq!(AliasSeq!(AliasSeq!(...))) > to: > AliasSeq!(AliasSeq!(...)) That's one option. Here's another: Template instantiations are interned as they are constructed (or at least

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread Stefan Koch via Digitalmars-d
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

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread Ethan Watson via Digitalmars-d
On Sunday, 11 December 2016 at 19:40:21 UTC, safety0ff wrote: That's not really useful for understanding and making progress on the issue. Uh, it kinda does actually. It's highlighting that a better hash function will only have a minor effect. The time sink is the number of instantiations

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread safety0ff via Digitalmars-d
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

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread Stefan Koch via Digitalmars-d
On Sunday, 11 December 2016 at 18:08:04 UTC, safety0ff wrote: On Sunday, 11 December 2016 at 17:20:24 UTC, Stefan Koch wrote: That means you have to compute the mangled name which is crazy expensive. And you can't cache the parent part of mangle because it all freshly generated by the

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread safety0ff via Digitalmars-d
On Sunday, 11 December 2016 at 17:20:24 UTC, Stefan Koch wrote: That means you have to compute the mangled name which is crazy expensive. And you can't cache the parent part of mangle because it all freshly generated by the template. How often would the mangle be needed regardless later on

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread Stefan Koch via Digitalmars-d
On Sunday, 11 December 2016 at 17:04:24 UTC, safety0ff wrote: On Sunday, 11 December 2016 at 16:26:29 UTC, Ethan Watson wrote: At the very least, I now have an idea of which parts of the compiler I'm taxing and can attempt to write around that. But I'm also tempted to go in and optimise

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread safety0ff via Digitalmars-d
On Sunday, 11 December 2016 at 16:26:29 UTC, Ethan Watson wrote: At the very least, I now have an idea of which parts of the compiler I'm taxing and can attempt to write around that. But I'm also tempted to go in and optimise those parts of the compiler. Have a look at this issue:

Re: Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread Stefan Koch via Digitalmars-d
On Sunday, 11 December 2016 at 16:26:29 UTC, Ethan Watson wrote: But I'm also tempted to go in and optimise those parts of the compiler. I already what I could to optimize those parts. whatever you manage to squeeze out. It's not going to do much good. The templates you are using are by their

Compiler performance with my ridiculous Binderoo code

2016-12-11 Thread Ethan Watson via Digitalmars-d
I've been keeping in contact with Stefan and providing him example code to test with his CTFE engine. He's been saying for a while that templates are slow. So I decided to finally work out just how slow we're talking about here. I can't show the exact code I'm running with, but needless to