Re: Slow code, slow

2018-02-27 Thread ketmar via Digitalmars-d
Martin Tschierschke wrote: basically, compilation of a code without templates is FAST. 500+ KB of source almost without templates often compiles in less than a second (on not-so-bleeding-edge i3, not even i7). but throw templates in a mix, and BOOM! coffee and cigarettes. My negative experi

Re: Slow code, slow

2018-02-27 Thread Martin Tschierschke via Digitalmars-d
On Tuesday, 27 February 2018 at 13:35:14 UTC, ketmar wrote: Martin Tschierschke wrote: On Tuesday, 27 February 2018 at 08:49:15 UTC, Stefan Koch wrote: On Monday, 26 February 2018 at 21:38:09 UTC, ketmar wrote: H. S. Teoh wrote: On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via Digitalma

Re: Slow code, slow

2018-02-27 Thread ketmar via Digitalmars-d
Martin Tschierschke wrote: On Tuesday, 27 February 2018 at 08:49:15 UTC, Stefan Koch wrote: On Monday, 26 February 2018 at 21:38:09 UTC, ketmar wrote: H. S. Teoh wrote: On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via Digitalmars-d wrote: [...] When looking at the problem of compilatio

Re: Slow code, slow

2018-02-27 Thread Stefan Koch via Digitalmars-d
On Tuesday, 27 February 2018 at 09:25:57 UTC, Martin Tschierschke wrote: On Tuesday, 27 February 2018 at 08:49:15 UTC, Stefan Koch wrote: On Monday, 26 February 2018 at 21:38:09 UTC, ketmar wrote: H. S. Teoh wrote: On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via Digitalmars-d wrote: [..

Re: Slow code, slow

2018-02-27 Thread Martin Tschierschke via Digitalmars-d
On Tuesday, 27 February 2018 at 08:49:15 UTC, Stefan Koch wrote: On Monday, 26 February 2018 at 21:38:09 UTC, ketmar wrote: H. S. Teoh wrote: On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via Digitalmars-d wrote: [...] When looking at the problem of compilation times I think: Wouldn't it

Re: Slow code, slow

2018-02-27 Thread Stefan Koch via Digitalmars-d
On Monday, 26 February 2018 at 21:38:09 UTC, ketmar wrote: H. S. Teoh wrote: On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via Digitalmars-d wrote: [...] but until that brave new world materializes, we have a smart/fast dilemma. alas. I'd like to contribute to the materialization of th

Re: Slow code, slow

2018-02-26 Thread ketmar via Digitalmars-d
H. S. Teoh wrote: On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via Digitalmars-d wrote: [...] but until that brave new world materializes, we have a smart/fast dilemma. alas. I'd like to contribute to the materialization of that brave new world. Rather than sit around and wait for it to

Re: Slow code, slow

2018-02-26 Thread H. S. Teoh via Digitalmars-d
On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via Digitalmars-d wrote: [...] > but until that brave new world materializes, we have a smart/fast > dilemma. alas. I'd like to contribute to the materialization of that brave new world. Rather than sit around and wait for it to happen. :-P T -

Re: Slow code, slow

2018-02-26 Thread ketmar via Digitalmars-d
H. S. Teoh wrote: The problem is not the Phobos implementation. The problem is that the compiler's way of handling templates and CTFE needs to be improved. We seriously need to muster some manpower to help Stefan finish newCTFE, and then we need to take a serious look at improving the current

Re: Slow code, slow

2018-02-26 Thread H. S. Teoh via Digitalmars-d
On Mon, Feb 26, 2018 at 09:03:14PM +0200, ketmar via Digitalmars-d wrote: > H. S. Teoh wrote: [...] > > In my mind, even C's printf API is sucky, because it involves runtime > > parsing of what's usually a static string, over and over again. What we > > *really* want is for something like: > > > >

Re: Slow code, slow

2018-02-26 Thread ketmar via Digitalmars-d
H. S. Teoh wrote: On Mon, Feb 26, 2018 at 08:38:39PM +0200, ketmar via Digitalmars-d wrote: H. S. Teoh wrote: On Sat, Feb 24, 2018 at 09:43:35AM +, Stefan Koch via Digitalmars-d wrote: [...] This particular slowdown happens because there are somehow depdencies on std.format.format which

Re: Slow code, slow

2018-02-26 Thread H. S. Teoh via Digitalmars-d
On Mon, Feb 26, 2018 at 08:42:22PM +0200, ketmar via Digitalmars-d wrote: [...] > p.p.s.: or replace it with `void fmtlite (...) {}` thingy. this way we > can still have type safety, but get rid of templates. Given the huge amount of templates in your typical, average D code, I think it's a much m

Re: Slow code, slow

2018-02-26 Thread H. S. Teoh via Digitalmars-d
On Mon, Feb 26, 2018 at 08:38:39PM +0200, ketmar via Digitalmars-d wrote: > H. S. Teoh wrote: > > > On Sat, Feb 24, 2018 at 09:43:35AM +, Stefan Koch via Digitalmars-d > > wrote: > > [...] > > > This particular slowdown happens because there are somehow > > > depdencies on std.format.format wh

Re: Slow code, slow

2018-02-26 Thread ketmar via Digitalmars-d
H. S. Teoh wrote: On Sat, Feb 24, 2018 at 09:43:35AM +, Stefan Koch via Digitalmars-d wrote: [...] This particular slowdown happens because there are somehow depdencies on std.format.format which is instantiated. Which has a ton of dependencies itself. Aha! That explains it. Thanks, St

Re: Slow code, slow

2018-02-26 Thread ketmar via Digitalmars-d
H. S. Teoh wrote: On Sat, Feb 24, 2018 at 09:43:35AM +, Stefan Koch via Digitalmars-d wrote: [...] This particular slowdown happens because there are somehow depdencies on std.format.format which is instantiated. Which has a ton of dependencies itself. Aha! That explains it. Thanks, St

Re: Slow code, slow

2018-02-26 Thread ketmar via Digitalmars-d
H. S. Teoh wrote: On Sat, Feb 24, 2018 at 09:43:35AM +, Stefan Koch via Digitalmars-d wrote: [...] This particular slowdown happens because there are somehow depdencies on std.format.format which is instantiated. Which has a ton of dependencies itself. Aha! That explains it. Thanks, St

Re: Slow code, slow

2018-02-26 Thread H. S. Teoh via Digitalmars-d
On Sat, Feb 24, 2018 at 09:43:35AM +, Stefan Koch via Digitalmars-d wrote: [...] > This particular slowdown happens because there are somehow depdencies > on std.format.format which is instantiated. > Which has a ton of dependencies itself. Aha! That explains it. Thanks, Stefan, for the accu

Re: Slow code, slow

2018-02-24 Thread Stefan Koch via Digitalmars-d
On Friday, 23 February 2018 at 20:15:12 UTC, H. S. Teoh wrote: Now that I got your attention: https://issues.dlang.org/show_bug.cgi?id=18511 tl;dr: A trivial piece of code, written as ostensibly "idiomatic D" with std.algorithm and std.range templates, compiles *an order of magnitude*

Re: Slow code, slow

2018-02-23 Thread Dmitry Olshansky via Digitalmars-d
On Saturday, 24 February 2018 at 00:21:06 UTC, Andrei Alexandrescu wrote: On 2/23/18 3:15 PM, H. S. Teoh wrote: tl;dr: A trivial piece of code, written as ostensibly "idiomatic D" with. Makes me cringe every time I hear "fast code, fast". Our old slogan is a much more accurate description of

Re: Slow code, slow

2018-02-23 Thread kdevel via Digitalmars-d
On Friday, 23 February 2018 at 20:15:12 UTC, H. S. Teoh wrote: Now that I got your attention: https://issues.dlang.org/show_bug.cgi?id=18511 Your bug report is about slowdown in *compilation* time. I wondered if the longer compilation time is due to the better (faster) generated code

Re: Slow code, slow

2018-02-23 Thread Rubn via Digitalmars-d
On Friday, 23 February 2018 at 21:10:25 UTC, H. S. Teoh wrote: On Fri, Feb 23, 2018 at 08:51:20PM +, Rubn via Digitalmars-d wrote: [...] This slowdown for this specific example isn't cause by templates, it's caused by having to parse all the extra lines of code from phobos. I didn't say the

Re: Slow code, slow

2018-02-23 Thread Andrei Alexandrescu via Digitalmars-d
On 2/23/18 3:15 PM, H. S. Teoh wrote: Now that I got your attention: https://issues.dlang.org/show_bug.cgi?id=18511 tl;dr: A trivial piece of code, written as ostensibly "idiomatic D" with std.algorithm and std.range templates, compiles *an order of magnitude* slower than the equivalent

Re: Slow code, slow

2018-02-23 Thread H. S. Teoh via Digitalmars-d
On Fri, Feb 23, 2018 at 08:51:20PM +, Rubn via Digitalmars-d wrote: [...] > This slowdown for this specific example isn't cause by templates, it's > caused by having to parse all the extra lines of code from phobos. I > didn't say there aren't problems with templates, but this example > accurat

Re: Slow code, slow

2018-02-23 Thread H. S. Teoh via Digitalmars-d
On Fri, Feb 23, 2018 at 08:41:17PM +, bauss via Digitalmars-d wrote: [...] > It actually matters a lot for big projects with lots of templates, > especially nested templates. Gets a whole lot worse when it's > templates within mixin templates with templates. The situation has actually improved

Re: Slow code, slow

2018-02-23 Thread Rubn via Digitalmars-d
On Friday, 23 February 2018 at 20:52:47 UTC, H. S. Teoh wrote: On Fri, Feb 23, 2018 at 08:35:44PM +, Rubn via Digitalmars-d wrote: [...] It's not that big of a slow down. Using "fast" you don't import any modules so they never have to be parsed. That's pretty much all of phobos you don't ha

Re: Slow code, slow

2018-02-23 Thread Rubn via Digitalmars-d
On Friday, 23 February 2018 at 20:41:17 UTC, bauss wrote: On Friday, 23 February 2018 at 20:35:44 UTC, Rubn wrote: On Friday, 23 February 2018 at 20:15:12 UTC, H. S. Teoh wrote: Now that I got your attention: https://issues.dlang.org/show_bug.cgi?id=18511 tl;dr: A trivial piece of cod

Re: Slow code, slow

2018-02-23 Thread H. S. Teoh via Digitalmars-d
On Fri, Feb 23, 2018 at 08:35:44PM +, Rubn via Digitalmars-d wrote: [...] > It's not that big of a slow down. Using "fast" you don't import any modules > so they never have to be parsed. That's pretty much all of phobos you don't > have to parse in that example. That's just the initial cost too

Re: Slow code, slow

2018-02-23 Thread bauss via Digitalmars-d
On Friday, 23 February 2018 at 20:35:44 UTC, Rubn wrote: On Friday, 23 February 2018 at 20:15:12 UTC, H. S. Teoh wrote: Now that I got your attention: https://issues.dlang.org/show_bug.cgi?id=18511 tl;dr: A trivial piece of code, written as ostensibly "idiomatic D" with std.algorithm

Re: Slow code, slow

2018-02-23 Thread Rubn via Digitalmars-d
On Friday, 23 February 2018 at 20:15:12 UTC, H. S. Teoh wrote: Now that I got your attention: https://issues.dlang.org/show_bug.cgi?id=18511 tl;dr: A trivial piece of code, written as ostensibly "idiomatic D" with std.algorithm and std.range templates, compiles *an order of magnitude*