This is an archive of the discontinued LLVM Phabricator instance.

Postpone module macro update until all headers are parsed.
Needs ReviewPublic

Authored by sepavloff on Oct 22 2015, 9:38 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This change fixes performance degradation reported in PR24667. The reason
of the problem is leaving module after each header, even if the next header
is of the same module. With this fix module state record counts the number of
headers parsed within particular module. Macro update starts when this number
reaches the number of headers specified in the module descriptor.

Using script from PR24667 the performance measurement gives numbers (compile
time vs number of headers):

128 0.0362679958344
256 0.0517950057983
512 0.0877501964569
1024 0.171896934509
2048 0.393149137497
4096 1.02584791183
8192 3.1531829834

While without the fix compiler demonstrates quadratic compile time:

128 0.0541491508484
256 0.121176958084
512 0.330996990204
1024 1.10708594322
2048 4.06581497192
4096 16.0358121395
8192 66.6967120171

Diff Detail

Event Timeline

sepavloff updated this revision to Diff 38141.Oct 22 2015, 9:38 AM
sepavloff retitled this revision from to Postpone module macro update until all headers are parsed..
sepavloff updated this object.
sepavloff added a subscriber: cfe-commits.