8000 update jmh plugin settings by qweek · Pull Request #410 · rsocket/rsocket-java · GitHub
[go: up one dir, main page]

Skip to content

update jmh plugin settings #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
*/

plugins {
id "com.gradle.build-scan" version "1.9"
id 'com.jfrog.bintray' version '1.7.3'
id 'com.gradle.build-scan' version '1.9' // declare before any other plugin

id 'com.github.sherter.google-java-format' version '0.6'
id 'com.github.johnrengelman.shadow' version '2.0.1' apply false
id 'me.champeau.gradle.jmh' version '0.4.4' apply false
id 'io.morethan.jmhreport' version '0.6.2.1' apply false

id 'com.jfrog.artifactory' version '4.5.2'
id 'me.champeau.gradle.jmh' version '0.4.4'
id 'com.jfrog.bintray' version '1.7.3'
}

repositories {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
52 changes: 46 additions & 6 deletions rsocket-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,56 @@
* limitations under the License.
*/

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'me.champeau.gradle.jmh'
apply plugin: 'io.morethan.jmhreport'

// disable tasks to stop generating duplicate files
jmhClasses.enabled = false
jmhRunBytecodeGenerator.enabled = false
jmhCompileGeneratedClasses.enabled = false

jmhJar {
// add jmh classes to shadow jar
from project.configurations.jmh
from project.configurations.jmhRuntime

// exclude logging classes
exclude 'org.slf4j:slf4j-log4j12'
exclude 'log4j:log4j'
}

jmh {
jmhVersion = "1.19"
profilers = ['gc']
zip64 = true
jmhVersion = '1.19'
includeTests = false
duplicateClassesStrategy = DuplicatesStrategy.WARN
zip64 = true

jvmArgs = ['-XX:+UnlockCommercialFeatures', '-XX:+FlightRecorder']
// NOTE: uncomment to add specific options
// jvmArgsAppend = ['-XX:+UseG1GC', '-Xms4g', '-Xmx4g']
profilers = ['gc']
resultFormat = 'JSON'

// include = ['io.rsocket.RSocketPerf.fireAndForgetHello']
}

dependencies {
jmh "org.openjdk.jmh:jmh-core:1.19"
jmh "org.openjdk.jmh:jmh-generator-annprocess:1.19"
// run report generation after benchmark
tasks.jmh.finalizedBy tasks.jmhReport

jmhReport {
jmhResultPath = project.file('build/reports/jmh/results.json')
jmhReportOutput = project.file('build/reports/jmh')
}

// remove directory generated by IDEA during benchmark
clean {
project.delete('out')
}

dependencies {
jmh "org.openjdk.jmh:jmh-core:${jmh.jmhVersion}"
jmh "org.openjdk.jmh:jmh-generator-annprocess:${jmh.jmhVersion}"

jmhRuntime "org.slf4j:slf4j-nop:$slf4jVersion"
}
5 changes: 2 additions & 3 deletions rsocket-core/src/jmh/java/io/rsocket/FragmentationPerf.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@

@BenchmarkMode(Mode.Throughput)
@Fork(
value = 1,
jvmArgsAppend = {"-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder"}
) // , "-Dio.netty.leakDetection.level=advanced"})
value = 1 // , jvmArgsAppend = {"-Dio.netty.leakDetection.level=advanced"}
)
@Warmup(iterations = 10)
@Measurement(iterations = 10_000)
@State(Scope.Thread)
Expand Down
3 changes: 1 addition & 2 deletions rsocket-core/src/jmh/java/io/rsocket/RSocketPerf.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@

@BenchmarkMode(Mode.Throughput)
@Fork(
value = 1,
jvmArgsAppend = {"-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder"}
value = 1 // , jvmArgsAppend = {"-Dio.netty.leakDetection.level=advanced"}
)
@Warmup(iterations = 10)
@Measurement(iterations = 10)
Expand Down
14 changes: 0 additions & 14 deletions rsocket-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,11 @@
* limitations under the License.
*/

apply plugin: 'me.champeau.gradle.jmh'

jmh {
jmhVersion = "1.19"
jvmArgs = ['-XX:+UseG1GC', '-Xmx4g', '-Xms4g', '-XX:+UnlockCommercialFeatures', '-XX:+FlightRecorder']
profilers = ['gc']
zip64 = true
warmupBatchSize = 10
iterations = 500
duplicateClassesStrategy = DuplicatesStrategy.WARN
}

dependencies {
compile project(':rsocket-core')
compile project(':rsocket-spectator')
compile project(':rsocket-transport-netty')
compile project(':rsocket-transport-local')

jmh "org.openjdk.jmh:jmh-generator-annprocess:1.19"

testCompile project(':rsocket-test')
}
0