Skip to content

Make resolveSuper less slow #2017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2017
Merged

Conversation

DarkDimius
Copy link
Contributor

@DarkDimius DarkDimius commented Feb 21, 2017

By reordering tests and performing cheaper ones first.

By ordering tests in a smarter way.
Add leave a big scary comment.
@DarkDimius DarkDimius changed the title Make refchecks less slow Make resolveSuper less slow Feb 21, 2017
@@ -40,6 +40,12 @@ class MixinOps(cls: ClassSymbol, thisTransform: DenotTransformer)(implicit ctx:
def isCurrent(sym: Symbol) =
ctx.atPhase(thisTransform) { implicit ctx =>
cls.info.member(sym.name).hasAltWith(_.symbol == sym)
// this is a hot spot, where we spend several seconds while compiling stdlib
// unfortunately it will discard and recompute all the member chaches,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: chaches -> caches

@odersky
Copy link
Contributor

odersky commented Feb 22, 2017

For comparison, here are timings from dotty boostrap (warm, 4th iteration), before the change in this PR.

[frontend in 8788ms]

[sbt-deps in 0ms]

[posttyper in 507ms]

[sbt-api in 0ms]

[pickler in 872ms]

[TreeTransform:{firstTransform, checkReentrant} in 157ms]

[TreeTransform:{refchecks, checkStatic, elimRepeated, normalizeFlags, extmethods, expandSAMs, tailrec, liftTry, classOf} in 991ms]

[TreeTransform:{tryCatchPatterns, patternMatcher, explicitOuter, explicitSelf, shortcutImplicits, crossCast, splitter} in 921ms]

[TreeTransform:{vcInlineMethods, isInstanceOfEvaluator, seqLiterals, intercepted, getters, elimByName, augmentScala2Traits, resolveSuper, primitiveForwarders, arrayConstructors} in 835ms]

[erasure in 1631ms]

[TreeTransform:{elimErasedValueType, vcElideAllocations, mixin, LazyVals, memoize, linkScala2ImplClasses, nonLocalReturns, capturedVars, constructors, functionalInterfaces, getClass} in 643ms]

[TreeTransform:{lambdaLift, elimStaticThis, flatten, restoreScopes} in 476ms]

[TreeTransform:{expandPrivate, selectStatic, collectEntryPoints, collectSuperCalls, dropInlined, moveStatic, labelDef} in 414ms]

[genBCode in 3912ms]

@smarter
Copy link
Member

smarter commented Feb 22, 2017

[sbt-api in 0ms]

For the comparison to be fair, you should run with -Yforce-sbt-phases since this is what we do in the tests: https://github.com/lampepfl/dotty/blob/master/compiler/test/dotc/tests.scala#L33

@odersky odersky merged commit 8a0a4fb into scala:master Feb 25, 2017
@allanrenucci allanrenucci deleted the refchecks-less-slow branch December 14, 2017 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants