-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
test performance please |
1 similar comment
test performance please |
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] = { |
There was a problem hiding this comment.
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.
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/3116 to see the changes. Benchmarks is based on merge(s) with master |
365a696
to
6ce9f10
Compare
Please also port the brand new scala/scala#6077, we might get it in dotty before it gets merged in scalac :) |
29215d8
to
02c96ea
Compare
} | ||
|
||
// This method is performance sensitive as it is used by SBT's ExtractDependencies phase. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
02c96ea
to
17246c0
Compare
@smarter Can we merge this? |
No description provided.