[Issue 4900] New: compiler still slow due to a single function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 20 05:20:57 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4900

           Summary: compiler still slow due to a single function
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: schveiguy at yahoo.com


--- Comment #0 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-09-20 05:20:20 PDT ---
As shown in bug 4721, there is still a problem in the compiler when compiling
projects with a large number of symbols.  Here is a profiled version of dmd
2.048 compiling unit tests for dcollections:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 80.31     11.99    11.99    19000     0.63     0.63  searchfixlist
  0.67     12.09     0.10   203173     0.00     0.00  StringTable::search(char
const*, unsigned int)
  0.60     12.18     0.09   369389     0.00     0.00  Lexer::scan(Token*)
  0.54     12.26     0.08   953613     0.00     0.00  ScopeDsymbol::search(Loc,
Identifier*, int)
  0.47     12.33     0.07  1449798     0.00     0.00  calccodsize
...

Note the searchfixlist function uses 80% of the runtime (the compiler takes 17
seconds to produce a result), but only has 19000 calls.  Compare that to other
functions which have orders of magnitude more calls but nothing takes more than
0.7%.

An examination of the searchfixlist function shows that it is a search through
a linked list.  I'm unsure if the same methodology (replace with hash) can be
applied as was in issue 4721, but it would be good to investigate possible
ideas to replace the algorithm there.

I opened this as a separate bug, because the original bug in 4721 was fixed.

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


More information about the Digitalmars-d-bugs mailing list