dweiss commented on a change in pull request #1550:
URL: https://github.com/apache/lucene-solr/pull/1550#discussion_r434352523
##########
File path: lucene/benchmark/build.gradle
##########
@@ -37,5 +37,121 @@ dependencies {
exclude module: "xml-apis"
})
+ runtimeOnly project(':lucene:analysis:icu')
+
testImplementation project(':lucene:test-framework')
}
+
+def tempDir = file("temp")
+def workDir = file("work")
+
+task run(type: JavaExec) {
+ description "Run a perf test (optional: -PtaskAlg=conf/your-algorithm-file
-PmaxHeapSize=1G)"
+ main 'org.apache.lucene.benchmark.byTask.Benchmark'
+ classpath sourceSets.main.runtimeClasspath
+ // allow these to be specified on the CLI via -PtaskAlg= for example
+ def taskAlg = propertyOrDefault('taskAlg', 'conf/micro-standard.alg')
Review comment:
I'd just inline taskAlg into the array for brevity, but it's fine as is
too.
##########
File path: lucene/benchmark/build.gradle
##########
@@ -37,5 +37,121 @@ dependencies {
exclude module: "xml-apis"
})
+ runtimeOnly project(':lucene:analysis:icu')
+
testImplementation project(':lucene:test-framework')
}
+
+def tempDir = file("temp")
+def workDir = file("work")
+
+task run(type: JavaExec) {
+ description "Run a perf test (optional: -PtaskAlg=conf/your-algorithm-file
-PmaxHeapSize=1G)"
+ main 'org.apache.lucene.benchmark.byTask.Benchmark'
+ classpath sourceSets.main.runtimeClasspath
+ // allow these to be specified on the CLI via -PtaskAlg= for example
+ def taskAlg = propertyOrDefault('taskAlg', 'conf/micro-standard.alg')
+ args = [taskAlg]
+
+ maxHeapSize = propertyOrDefault('maxHeapSize', '1G')
+
+ String stdOutStr = propertyOrDefault('standardOutput', null)
Review comment:
Just had a random thought that if you don't redirect to a file the
process is piped between gradle (parent) and this may cause artificial
slowdowns on buffers between processes... Don't know if this matters but an
alternative design could create a temporary file (task class has a method for
creating task-relative temporary files), redirect the output into that file
(always) and only pipe it to the console at the end if stdOutStr is not
defined.
I really don't know how these benchmarks are used in practice but I wanted
to signal a potential issue here.
##########
File path: lucene/benchmark/build.gradle
##########
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-
-apply plugin: 'java-library'
+apply plugin: 'java'
+// NOT a 'java-library'. Maybe 'application' but seems too limiting.
Review comment:
I think java plugin is more than fine here so remove the comment for the
final version, maybe?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]