forked from vadyushkins/kotgll
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
193 additions
and
134 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
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,17 @@ | ||
package org | ||
|
||
import kotlinx.benchmark.* | ||
import java.io.File | ||
@State(Scope.Benchmark) | ||
abstract class BaseBench { | ||
@Param("Throwables.java") | ||
var fileName: String = "" | ||
|
||
lateinit var fileContents: String | ||
|
||
@Setup | ||
open fun prepare() { | ||
fileContents = File(fileName).readText() | ||
} | ||
|
||
} |
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,16 @@ | ||
package org | ||
|
||
import kotlinx.benchmark.* | ||
import org.ucfs.input.LinearInputLabel | ||
|
||
|
||
@State(Scope.Benchmark) | ||
class OfflineGll : BaseBench() { | ||
|
||
@Benchmark | ||
fun measureGll(blackhole: Blackhole) { | ||
val parser = org.ucfs.Java8Parser<Int, LinearInputLabel>() | ||
parser.input = getTokenStream(fileContents) | ||
blackhole.consume(parser.parse()) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
package org | ||
|
||
import kotlinx.benchmark.* | ||
import org.junit.Before | ||
import org.ucfs.Java8 | ||
import org.ucfs.input.LinearInput | ||
import org.ucfs.input.LinearInputLabel | ||
import org.ucfs.parser.Gll | ||
|
||
|
||
@State(Scope.Benchmark) | ||
class OnlineGll : BaseBench(){ | ||
|
||
val startState = Java8().rsm | ||
lateinit var tokens: LinearInput<Int, LinearInputLabel> | ||
|
||
@Setup | ||
@Before | ||
override fun prepare() { | ||
super.prepare() | ||
tokens = getTokenStream(fileContents) | ||
} | ||
|
||
@Benchmark | ||
fun measureGll(blackhole: Blackhole) { | ||
val gll = Gll.gll(startState, getTokenStream(fileContents)) | ||
blackhole.consume(gll.parse()) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
package org | ||
|
||
import kotlinx.benchmark.* | ||
import org.ucfs.Java8 | ||
import org.ucfs.input.LinearInputLabel | ||
import org.ucfs.parser.Gll | ||
|
||
|
||
@State(Scope.Benchmark) | ||
class RecoveryOfflineGll : BaseBench() { | ||
|
||
@Benchmark | ||
fun measureGll(blackhole: Blackhole) { | ||
val parser = org.ucfs.Java8Parser<Int, LinearInputLabel>() | ||
parser.input = getRecoveryTokenStream(fileContents) | ||
blackhole.consume(parser.parse()) | ||
} | ||
} | ||
//fun main(){ | ||
// val inp = getRecoveryTokenStream( | ||
// """ public clas HellowWorldCTY{ | ||
// } | ||
// | ||
// """.trimIndent() | ||
// ) | ||
// val p = Gll.recoveryGll(Java8().rsm, inp) | ||
// assert(p.parse().first != null) | ||
// val parser = org.ucfs.Java8Parser<Int, LinearInputLabel>() | ||
// parser.input = inp | ||
// assert(parser.parse().first != null) | ||
//} |
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,29 @@ | ||
package org | ||
|
||
import kotlinx.benchmark.* | ||
import org.junit.Before | ||
import org.ucfs.Java8 | ||
import org.ucfs.input.LinearInput | ||
import org.ucfs.input.LinearInputLabel | ||
import org.ucfs.parser.Gll | ||
|
||
|
||
@State(Scope.Benchmark) | ||
class RecoveryOnlineGll : BaseBench(){ | ||
|
||
val startState = Java8().rsm | ||
lateinit var tokens: LinearInput<Int, LinearInputLabel> | ||
|
||
@Setup | ||
@Before | ||
override fun prepare() { | ||
super.prepare() | ||
tokens = getRecoveryTokenStream(fileContents) | ||
} | ||
|
||
@Benchmark | ||
fun measureGll(blackhole: Blackhole) { | ||
val gll = Gll.recoveryGll(startState, getRecoveryTokenStream(fileContents)) | ||
blackhole.consume(gll.parse()) | ||
} | ||
} |
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,9 @@ | ||
for dataset in /home/olga/gllgen/dataset_black_box/too_little #/home/olga/gllgen/java7 | ||
do | ||
for tool in Antlr Online Offline | ||
do | ||
echo "running $tool on $dataset, start at $(date)" | ||
gradle benchmark -PtoolName=$tool -Pdataset=$dataset >> stdout_$tool.txt 2>> stderr_$tool.txt | ||
done | ||
done | ||
|
Oops, something went wrong.