www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DerelictGL3 slow compilation speed with contexts

reply Igor <stojkovic.igor gmail.com> writes:
Hi All,

I switched from using free functions in DerelictGL3 to 
DerelictGL3_Contexts and compilation speed in optimized build 
using DMD went from 2 seconds to 7 minutes and using LDC from 2 
seconds to 10 seconds. Is this a known problem? Are there any 
workarounds?
Sep 12 2017
parent reply Mike Parker <aldacron gmail.com> writes:
On Tuesday, 12 September 2017 at 21:55:23 UTC, Igor wrote:
 Hi All,

 I switched from using free functions in DerelictGL3 to 
 DerelictGL3_Contexts and compilation speed in optimized build 
 using DMD went from 2 seconds to 7 minutes and using LDC from 2 
 seconds to 10 seconds. Is this a known problem? Are there any 
 workarounds?
The support for contexts is still relatively new and I've received no feedback specific to it since I first released it in the 2.0 alpha. Given the heavy use of string & template mixins, it's possible I'm hitting a corner case somewhere. In my simple tests, I haven't seen it. So the only way I'm going to be able to narrow it down is with a minimal example that I can compile and test with. Is there anything you can give me?
Sep 12 2017
parent reply Igor <stojkovic.igor gmail.com> writes:
On Wednesday, 13 September 2017 at 01:30:10 UTC, Mike Parker 
wrote:
 On Tuesday, 12 September 2017 at 21:55:23 UTC, Igor wrote:
 Hi All,

 I switched from using free functions in DerelictGL3 to 
 DerelictGL3_Contexts and compilation speed in optimized build 
 using DMD went from 2 seconds to 7 minutes and using LDC from 
 2 seconds to 10 seconds. Is this a known problem? Are there 
 any workarounds?
The support for contexts is still relatively new and I've received no feedback specific to it since I first released it in the 2.0 alpha. Given the heavy use of string & template mixins, it's possible I'm hitting a corner case somewhere. In my simple tests, I haven't seen it. So the only way I'm going to be able to narrow it down is with a minimal example that I can compile and test with. Is there anything you can give me?
Well since minimal example is a window app that opens a window, sets everything up and calls opengl stuff I will just push it to my github project this evening and you will can try with that. I will let you know when its done. In the meantime I can tell you that it seems that the main culprit for long compile time is "-inline" compiler option.
Sep 13 2017
parent reply Mike Parker <aldacron gmail.com> writes:
On Wednesday, 13 September 2017 at 10:28:26 UTC, Igor wrote:

 Well since minimal example is a window app that opens a window,
 sets everything up and calls opengl stuff I will just push it
 to my github project this evening and you will can try with 
 that.
 I will let you know when its done.

 In the meantime I can tell you that it seems that the main 
 culprit
 for long compile time is "-inline" compiler option.
In that case, I should be able to reproduce it. I've not compiled the context stuff with -inline before. Once I do reproduce it, I'll open an issue over github for future discussion. I'll let you know if I need more info.
Sep 13 2017
parent reply Igor <stojkovic.igor gmail.com> writes:
On Wednesday, 13 September 2017 at 13:25:01 UTC, Mike Parker 
wrote:
 On Wednesday, 13 September 2017 at 10:28:26 UTC, Igor wrote:

 Well since minimal example is a window app that opens a window,
 sets everything up and calls opengl stuff I will just push it
 to my github project this evening and you will can try with 
 that.
 I will let you know when its done.

 In the meantime I can tell you that it seems that the main 
 culprit
 for long compile time is "-inline" compiler option.
In that case, I should be able to reproduce it. I've not compiled the context stuff with -inline before. Once I do reproduce it, I'll open an issue over github for future discussion. I'll let you know if I need more info.
I tested it again with my entire project and it seems it is not inline thing but -O (optimized build). You can checkout the project here: https://github.com/igor84/dngin if you try to build it with "dub build -ax86_64 -b release" you will experience very long compilation.
Sep 13 2017
parent Mike Parker <aldacron gmail.com> writes:
On Wednesday, 13 September 2017 at 16:30:34 UTC, Igor wrote:

 I tested it again with my entire project and it seems it is not 
 inline thing but -O (optimized build). You can checkout the 
 project here: https://github.com/igor84/dngin

 if you try to build it with "dub build -ax86_64 -b release" you 
 will experience very long compilation.
So I was able to reproduce this with my test app. It's going to be a bear to debug. I'll devote some time to it this weekend and see where that gets me. I've opened an issue for future discussion: https://github.com/DerelictOrg/DerelictGL3/issues/58
Sep 14 2017