Skip to content

Port ClassPath optimisations and bug fixes from scalac #3116

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 4 commits into from
Sep 20, 2017

Conversation

allanrenucci
Copy link
Contributor

No description provided.

@allanrenucci
Copy link
Contributor Author

test performance please

1 similar comment
@smarter
Copy link
Member

smarter commented Sep 13, 2017

test performance please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 1 running.

private def aggregatesForPackage(pkg: String): Seq[ClassPath] = packageIndex.synchronized {
packageIndex.getOrElseUpdate(pkg, aggregates.filter(_.hasPackage(pkg)))
}

override def findClassFile(className: String): Option[AbstractFile] = {
Copy link
Member

Choose a reason for hiding this comment

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

In the scalac implementation, this method is above packageIndex, it'd be good to keep it that way here to, to reduce the source diff between the two implementations.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/3116 to see the changes.

Benchmarks is based on merge(s) with master

@smarter
Copy link
Member

smarter commented Sep 13, 2017

Please also port the brand new scala/scala#6077, we might get it in dotty before it gets merged in scalac :)

}

// This method is performance sensitive as it is used by SBT's ExtractDependencies phase.
Copy link
Member

Choose a reason for hiding this comment

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

This comment should be removed in dotty since the sbt integration does not actually call findClass (same for the identical comment in ZipAndJarFileLookupFactory.scala)

@@ -19,23 +22,17 @@ import FileUtils._
* when there are a lot of projects having a lot of common dependencies.
Copy link
Member

Choose a reason for hiding this comment

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

This comment was modified in the original commit.

Adapted from scala commits b9520211b22e53d4f80801b0f64cdb6275ac55cf and
bd7341754f8aec4ddbf455544eb393ff6cf4a43a by Jason Zaugg and Lukas Rytz
in scala/scala#5956:

 - Rather than `findAll.filter(_.name == name)`, just lookup the entry
   with the right name to start with.
 - Avoid a linear scan of aggregate classpath by building and index
   keyed on
   package names
Adapted from scalac commit bcf47b165ccfd8e1827188f70aeb24e2cecfb80f by
Jason Zaugg in scala/scala#6064:

Use the last modified timestamp and the file inode to help detect
when the file has been overwritten (as is common in SBT builds
with `exportJars := true`, or when using snapshot dependencies).

Fixes scala/bug#10295
Adapted from scala commit 3d7e5c3888e0c0ce46315ea6918fd03b22f1fcb4 by
Jason Zaugg in scala/scala#6077
@allanrenucci
Copy link
Contributor Author

@smarter Can we merge this?

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