February 08, 2012
I created a new bug in Bugzilla for the error message, since a specific case was resolved and it's really a completely different issue.

On Wed, Feb 8, 2012 at 2:48 PM, Don Clugston <dclugston at googlemail.com>wrote:

> On 8 February 2012 18:57, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> > On Wednesday, February 08, 2012 18:15:30 Jacob Carlborg wrote:
> >> But if you put the "static if"-statement after all fields, shouldn't
> that be
> >> enough to have the full size of the struct. Of course it could be hard
> for
> >> the compiler to know that there are no fields after the "static if"-statement. Maybe the compiler could calculate the size
> incrementally.
> >
> > That could cause big problems if the static if weren't after all of the
> member
> > variables. You could have multiple static ifs, each of which ended up
> with a
> > different size for the type, if there are member variables declared
> between
> > them. We _could_ make it give an error if you then added a member
> variable
> > after such a static if, but that's probably getting a bit complicated,
> since
> > more state is necessary. So, it's probably better to just disallow such
> static
> > ifs.
>
> More specifically, it's not static if which is the problem, it's that .tupleof shouldn't be legal until all members have been declared. BTW if a static if body doesn't contain any declarations, there's not much it can contain that's meaningful!
>
> I think that based on the error message issue, the bug should stay
> open, but not as a regression.
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-beta/attachments/20120208/5acc7499/attachment.html>
February 08, 2012
I'm not sure if I'll have time to track this down, but I'm seeing a severe performance issue. A 40 second task in 2.056 is taking 22 minutes with 2.058.

The program makes calls out to Lua which in turn calls back to D.

I'll be in Japan for three weeks and not sure how much time I'll have to narrow this in the next couple days.

On Wed, Feb 8, 2012 at 2:50 AM, Walter Bright <walter at digitalmars.com> wrote:
> http://ftp.digitalmars.com/dmd2beta.zip
>
> I'm calling it an alpha because we haven't resolved the associative array
> issue. But I want to see if there are any others before we do a release.
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta



-- 
Liberty means responsibility. That is why most men dread it. ? - George Bernard Shaw
February 08, 2012
> But if you put the "static if"-statement after all fields, shouldn't that be enough to have the full size of the struct. Of course it could be hard for the compiler to know that there are no fields after the "static if"-statement. Maybe the compiler could calculate the size incrementally.
>

Static ifs can change the semantics of a type. Now if the static if
condition itself
depends on that type you have a cycle. Allowing such cycles under certain
circumstances
could create a lot of confusion.
February 08, 2012
On Wed, 08 Feb 2012 20:55:39 +0100, Jesse Phillips <jesse.k.phillips at gmail.com> wrote:

> I'm not sure if I'll have time to track this down, but I'm seeing a severe performance issue. A 40 second task in 2.056 is taking 22 minutes with 2.058.
>
Can you share the tested code?
February 08, 2012
Maybe, I'm reducing where I think it is and it is looking like the problem comes from spellcheck. I'll see if I can build up some test data that demonstrates the problem. You can see the implementation of the library:

https://github.com/he-the-great/JPDLibs/blob/spelling/spelling/suggestion.d

It does make use of an associative arrays which is a hot topic at this point...

On Wed, Feb 8, 2012 at 12:10 PM, Martin Nowak <dawg at dawgfoto.de> wrote:
> On Wed, 08 Feb 2012 20:55:39 +0100, Jesse Phillips <jesse.k.phillips at gmail.com> wrote:
>
>> I'm not sure if I'll have time to track this down, but I'm seeing a severe performance issue. A 40 second task in 2.056 is taking 22 minutes with 2.058.
>>
> Can you share the tested code?
February 08, 2012
Ok, it is the new std.regex engine, so it wouldn't be a regression from 2.057.

With
2.056: 0.22sec
2.058: 7.65sec

import std.file;
import std.string;
import std.datetime;
import std.regex;

private int[string] model;

void main() {
   auto name = "english.dic";
   foreach(w; std.file.readText(name).toLower.splitLines)
      model[w] += 1;

   foreach(w; std.string.split(readText(name)))
      if(!match(w, regex(r"\d")).empty)
      {}
}
February 08, 2012
On 08.02.2012 22:14, Jesse Phillips wrote:
> Ok, it is the new std.regex engine, so it wouldn't be a regression from 2.057.
>
>     foreach(w; std.string.split(readText(name)))
>        if(!match(w, regex(r"\d")).empty)
>        {}

I have not tried, but I guess the trouble comes from rebuilding the regex engine for every word. Did you try

    auto re = regex(r"\d");
    foreach(w; std.string.split(readText(name)))
       if(!match(w, re).empty)
       {}


February 08, 2012
+Dmitry

The old regex had a nice optimization for such cases - it cached the last engine built.

Dmitry, any idea on how we can approach this?


Andrei

On 2/8/12 1:53 PM, Rainer Schuetze wrote:
> On 08.02.2012 22:14, Jesse Phillips wrote:
>> Ok, it is the new std.regex engine, so it wouldn't be a regression from 2.057.
>>
>> foreach(w; std.string.split(readText(name)))
>> if(!match(w, regex(r"\d")).empty)
>> {}
>
> I have not tried, but I guess the trouble comes from rebuilding the regex engine for every word. Did you try
>
> auto re = regex(r"\d");
> foreach(w; std.string.split(readText(name)))
> if(!match(w, re).empty)
> {}
>
>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
February 08, 2012
Yes that is it. Thank you. You all can decide if this needs addressing, knowing the reason it seems important to understand the cost, but a special case might make coding a little easier, if calling a function in a loop which does a regex.

On Wed, Feb 8, 2012 at 1:53 PM, Rainer Schuetze
> I have not tried, but I guess the trouble comes from rebuilding the regex engine for every word. Did you try
>
> ? auto re = regex(r"\d");
> ? foreach(w; std.string.split(readText(name)))
> ? ? ?if(!match(w, re).empty)
> ? ? ?{}
1 2
Next ›   Last »