www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3532] New: benchmark function consumes 100% CPU when used with anonymous delegate

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3532

           Summary: benchmark function consumes 100% CPU when used with
                    anonymous delegate
           Product: D
           Version: 2.036
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: vadmyst gmail.com


--- Comment #0 from Vadym Stetsiak <vadmyst gmail.com> 2009-11-20 06:28:03 PST
---
Following code, consumes 100% for an infinite period of time.

However, if I use benchmark with predefined function - everything is OK.

The code to reproduce:

import std.date;

void main()
{
        ulong[] measures = benchmark!(delegate void()
        {
                for(int i = 0; i < 100_000; i++)
                {
                        auto res1 = cmp1 == cmp2;
                }

        })(1, null);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3532


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com


--- Comment #1 from Andrei Alexandrescu <andrei metalanguage.com> 2009-11-20
10:06:35 PST ---
Thank you for going through the trouble of creating an account and reporting
this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3532


Lars T. Kyllingstad <bugzilla kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |bugzilla kyllingen.net
         Resolution|                            |INVALID


--- Comment #2 from Lars T. Kyllingstad <bugzilla kyllingen.net> 2010-06-21
11:41:16 PDT ---
This is not a Phobos issue, it's a bug in DMD.  I've reported it with a reduced
test case, see issue 4359.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 21 2010