-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implemented read benchmarks for ODB * Implemented read benchmarks for TinkerGraph * Fixed infinity ops issue * Process commit * Draft Neo4j implemented * Neo4j working & started benchmarking SBT task * Running benchmarking via SBT and Scala Scripts + updated readme * Added full dataset * Pushed other drivers to benchmarking set
- Loading branch information
1 parent
5c97e7f
commit 8e904e0
Showing
13 changed files
with
834 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ graph.xml | |
gsql_client.* | ||
*.txt | ||
*.csv | ||
/workspace | ||
/results | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import java.io.File | ||
import java.net.URI | ||
import java.nio.file.{Files, Path, Paths} | ||
|
||
object DownloadHelper { | ||
val LocalStorageDir = Paths.get(".local/source-urls") | ||
|
||
/** Downloads the remote file from the given url if either | ||
* - the localFile is not available, | ||
* - or the url is different from the previously downloaded file | ||
* - or we don't have the original url from the previously downloaded file | ||
* We store the information about the previously downloaded urls and the localFile in `.local` | ||
*/ | ||
def ensureIsAvailable(url: String, localFile: File): Unit = { | ||
if (!localFile.exists() || Option(url) != previousUrlForLocalFile(localFile)) { | ||
val localPath = localFile.toPath | ||
Files.deleteIfExists(localPath) | ||
|
||
println(s"[INFO] downloading $url to $localFile") | ||
sbt.io.Using.urlInputStream(new URI(url).toURL) { inputStream => | ||
sbt.IO.transfer(inputStream, localFile) | ||
} | ||
|
||
// persist url in local storage | ||
val storageFile = storageInfoFileFor(localFile) | ||
Files.createDirectories(storageFile.getParent) | ||
Files.writeString(storageFile, url) | ||
} | ||
} | ||
|
||
private def relativePathToProjectRoot(path: Path): String = | ||
Paths | ||
.get("") | ||
.toAbsolutePath | ||
.normalize() | ||
.relativize(path.toAbsolutePath) | ||
.toString | ||
|
||
private def previousUrlForLocalFile(localFile: File): Option[String] = { | ||
Option(storageInfoFileFor(localFile)) | ||
.filter(Files.exists(_)) | ||
.map(Files.readString) | ||
.filter(_.nonEmpty) | ||
} | ||
|
||
private def storageInfoFileFor(localFile: File): Path = | ||
LocalStorageDir.resolve(relativePathToProjectRoot(localFile.toPath)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import scala.sys.process.* | ||
import java.nio.file.Files | ||
import java.nio.file.Path | ||
import scala.jdk.CollectionConverters.* | ||
|
||
@main def main(): Unit = { | ||
println("[info] Ensuring compilation status and benchmark dataset availability...") | ||
"sbt compile benchmarkDownloadTask".! | ||
|
||
val datasetDir = Path.of("workspace", "defects4j") | ||
val resultsDir = Path.of("results") | ||
|
||
if (!Files.exists(resultsDir)) Files.createDirectory(resultsDir) | ||
|
||
def benchmarkArgs(driver: String, project: String): String = { | ||
val projectDir = Path.of(datasetDir.toString, project) | ||
val projectName = project.toLowerCase.stripSuffix(".jar") | ||
val resultsPath = Path.of(resultsDir.toString, s"results-$driver-$projectName") | ||
val outputPath = Path.of(resultsDir.toString, s"output-$driver-$projectName") | ||
s"Jmh/runMain com.github.plume.oss.Benchmark $driver $projectDir -o ${outputPath.toAbsolutePath} -r ${resultsPath.toAbsolutePath}" | ||
} | ||
|
||
println("[info] Available projects:") | ||
val projects = Files.list(datasetDir).filter(_.toString.endsWith(".jar")).toList.asScala.toList | ||
projects.foreach(p => println(s" - ${p.getFileName.toString}")) | ||
|
||
println("[info] Available drivers:") | ||
val drivers = Seq("overflowdb") | ||
drivers.foreach(d => println(s" - $d")) | ||
|
||
drivers.foreach { driver => | ||
projects.foreach { project => | ||
val cmd = benchmarkArgs(driver, project.getFileName.toString) | ||
println(s"[info] Benchmarking '$driver' on project '$project'") | ||
s"sbt \"$cmd\"".! | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.