This commit is contained in:
2021-09-26 12:24:37 +02:00
parent 38b5416752
commit 61f5853ab9
17 changed files with 247 additions and 256 deletions

19
benchmark/build.gradle Normal file
View File

@@ -0,0 +1,19 @@
plugins {
id 'org.jetbrains.kotlin.jvm'
id 'application'
}
dependencies {
implementation group: 'net.woggioni', name: 'jwo', version: getProperty('version.jwo')
implementation(rootProject)
// runtime(files(rootProject.projectDir.toPath().resolve("src/test/resources")))
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_11
}
application {
mainClassName = "net.woggioni.klevtree.benchmark.BenchmarkKt"
}

View File

@@ -1,28 +0,0 @@
plugins {
kotlin("jvm")
application
}
group = "woggioni.net"
version = "0.1"
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
compile(rootProject)
// runtime(files(rootProject.projectDir.toPath().resolve("src/test/resources")))
}
application {
mainClassName = "net.woggioni.klevtree.benchmark.BenchmarkKt"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -1 +0,0 @@
rootProject.name = "klevtree-benchmark"

View File

@@ -1,14 +1,11 @@
package net.woggioni.klevtree.benchmark
import net.woggioni.klevtree.ILevTrie
import net.woggioni.klevtree.LevTrie
import java.io.BufferedReader
import java.io.InputStreamReader
import net.woggioni.jwo.Chronometer
fun main(args: Array<String>) {
fun main() {
val reader = BufferedReader(
InputStreamReader(Chronometer::class.java.getResourceAsStream("/cracklib-small"))
)
@@ -21,7 +18,7 @@ fun main(args: Array<String>) {
} finally {
reader.close()
}
tree.algorithm = ILevTrie.Algorithm.DAMERAU_LEVENSHTEIN
tree.algorithm = LevTrie.Algorithm.DAMERAU_LEVENSHTEIN
tree.caseSensitive = false
val chr = Chronometer()
val keys = arrayOf("camel", "coriolis", "mattel", "cruzer", "cpoper", "roublesoot")