summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-06-14 16:34:02 +0000
committerPaul Phillips <paulp@improving.org>2011-06-14 16:34:02 +0000
commite4f800b20550b62d5186130c6f06281f3df3ed90 (patch)
tree869779cb8fbc32b9888e34b7ec67813bcf884a89 /src/partest
parent7fa4ca91ffc1d36f0cb1fe89998578aea242e2f9 (diff)
downloadscala-e4f800b20550b62d5186130c6f06281f3df3ed90.tar.gz
scala-e4f800b20550b62d5186130c6f06281f3df3ed90.tar.bz2
scala-e4f800b20550b62d5186130c6f06281f3df3ed90.zip
More batched performance improvements for io.{ ...
More batched performance improvements for io.{ File, Classpath } and others in the neighborhood. Avoids calling the expensive getCanonicalPath in favor of getAbsolutePath: I note that because it has the potential to change compiler behavior at the borders. No review.
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/nest/ConsoleRunner.scala2
-rw-r--r--src/partest/scala/tools/partest/nest/FileManager.scala2
-rw-r--r--src/partest/scala/tools/partest/nest/Worker.scala12
3 files changed, 8 insertions, 8 deletions
diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
index 3957192f70..953823ef77 100644
--- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
+++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
@@ -143,7 +143,7 @@ class ConsoleRunner extends DirectRunner {
val dir =
if (fileManager.testClasses.isDefined) fileManager.testClassesDir
else fileManager.testBuildFile getOrElse {
- fileManager.latestCompFile.getParentFile.getParentFile.getCanonicalFile
+ fileManager.latestCompFile.getParentFile.getParentFile.getAbsoluteFile
}
val vmBin = javaHome + File.separator + "bin"
diff --git a/src/partest/scala/tools/partest/nest/FileManager.scala b/src/partest/scala/tools/partest/nest/FileManager.scala
index e23063640f..a9bf186a44 100644
--- a/src/partest/scala/tools/partest/nest/FileManager.scala
+++ b/src/partest/scala/tools/partest/nest/FileManager.scala
@@ -27,7 +27,7 @@ trait FileManager {
*/
def compareFiles(f1: File, f2: File): String = {
val diffWriter = new StringWriter
- val args = Array(f1.getCanonicalPath(), f2.getCanonicalPath())
+ val args = Array(f1.getAbsolutePath(), f2.getAbsolutePath())
DiffPrint.doDiff(args, diffWriter)
val res = diffWriter.toString
diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala
index bfa6427d21..88ea62353e 100644
--- a/src/partest/scala/tools/partest/nest/Worker.scala
+++ b/src/partest/scala/tools/partest/nest/Worker.scala
@@ -525,7 +525,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor
val succFn: (File, File) => Boolean = { (logFile, outDir) =>
NestUI.verbose("compilation of "+file+" succeeded\n")
- val outURL = outDir.getCanonicalFile.toURI.toURL
+ val outURL = outDir.getAbsoluteFile.toURI.toURL
val logWriter = new PrintStream(new FileOutputStream(logFile), true)
Output.withRedirected(logWriter) {
@@ -616,7 +616,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor
// create proper settings for the compiler
val settings = new Settings(workerError)
- settings.outdir.value = outDir.getCanonicalFile.getAbsolutePath
+ settings.outdir.value = outDir.getAbsoluteFile.getAbsolutePath
settings.sourcepath.value = sourcepath
settings.classpath.value = fileManager.CLASSPATH
settings.Ybuildmanagerdebug.value = true
@@ -723,12 +723,12 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor
// run compiler in resident mode
// $SCALAC -d "$os_dstbase".obj -Xresident -sourcepath . "$@"
- val sourcedir = logFile.getParentFile.getCanonicalFile
+ val sourcedir = logFile.getParentFile.getAbsoluteFile
val sourcepath = sourcedir.getAbsolutePath+File.separator
NestUI.verbose("sourcepath: "+sourcepath)
val argString =
- "-d "+outDir.getCanonicalFile.getAbsolutePath+
+ "-d "+outDir.getAbsoluteFile.getPath+
" -Xresident"+
" -sourcepath "+sourcepath
val argList = argString split ' ' toList
@@ -976,7 +976,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor
react {
case Timeout(file) =>
- updateStatus(file.getCanonicalPath, TestState.Timeout)
+ updateStatus(file.getAbsolutePath, TestState.Timeout)
val swr = new StringWriter
val wr = new PrintWriter(swr, true)
printInfoStart(file, wr)
@@ -988,7 +988,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor
case Result(file, logs) =>
val state = if (succeeded) TestState.Ok else TestState.Fail
- updateStatus(file.getCanonicalPath, state)
+ updateStatus(file.getAbsolutePath, state)
reportResult(
state,
logs.file,