www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9783] New: tracing of recursive function calls yields bad timing

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

           Summary: tracing of recursive function calls yields bad timing
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: r.sagitario gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario gmx.de> 2013-03-22 02:47:23
PDT ---
Compiling this code:

int foo(int n)
{
    if (n <= 0)
        return 0;
    return foo(n-1) + foo(n-2);
}

void main()
{
    foo(30);
}

with "dmd -profile test.d" and exceuting it yields a trace.log containing

  Num          Tree        Func        Per
  Calls        Time        Time        Call

4356617     4337248      201989           0     int test.foo(int)
      1      201989           0           0     _Dmain

that reports that the tree time of foo was a lot larger than the tree time of
its only caller.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 22 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9783



--- Comment #1 from github-bugzilla puremagic.com 2013-03-22 12:49:15 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/f84708e9cb4811ad7b71f104c7c9704672665124
fix issue 9783: fix tree time when profiling recursive functions

https://github.com/D-Programming-Language/druntime/commit/187cee5ca665e314de433649df2272d9e70880e2
Merge pull request #461 from rainers/fix_profile_treetime

fix issue 9783: fix tree time when profiling recursive functions

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 22 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9783



--- Comment #2 from github-bugzilla puremagic.com 2013-03-22 12:58:03 PDT ---
Commit pushed to phobos-1.x at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/3ea3ec6c8ccc2b7b8a82d12a823b6b774bb53ee6
merge D2 push #461, fix Issue 9783

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 22 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9783


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 27 2013