@@ -103,6 +103,7 @@ def profParser(s: State): Parser[String] = {
103
103
}
104
104
105
105
commands += Command .custom((s : State ) => Command .applyEffect(profParser(s))((line : String ) => {
106
+ val flameGraphOpts = s " --minwidth,1,--colors,java,--cp,--width,1800 "
106
107
abstract class Profiler (val name : String ) {
107
108
def command (outDir : File ): String
108
109
}
@@ -111,10 +112,10 @@ commands += Command.custom((s: State) => Command.applyEffect(profParser(s))((lin
111
112
def command (outDir : File ): String = " -jvmArgs -Xprof -prof hs_comp -prof hs_gc -prof stack -prof hs_rt"
112
113
}
113
114
object jfr extends Profiler (" jfr" ) {
114
- def command (outDir : File ): String = s " -prof jmh.extras.JFR:dir= ${outDir.getAbsolutePath};flameGraphOpts=--hash,--minwidth,1 ;verbose=true' "
115
+ def command (outDir : File ): String = s " -prof jmh.extras.JFR:dir= ${outDir.getAbsolutePath};flameGraphOpts= $flameGraphOpts ;verbose=true' "
115
116
}
116
117
object async extends Profiler (" async" ) {
117
- def command (outDir : File ): String = s " -prof jmh.extras.Async:dir= ${outDir.getAbsolutePath};flameGraphOpts=--hash,--minwidth,1 ;verbose=true;event=cpu "
118
+ def command (outDir : File ): String = s " -prof jmh.extras.Async:dir= ${outDir.getAbsolutePath};flameGraphOpts= $flameGraphOpts ;verbose=true;event=cpu " // + ";simpleName=true" TODO add this after upgrading next sbt-jmh release
118
119
}
119
120
object perfNorm extends Profiler (" perfNorm" ) {
120
121
def command (outDir : File ): String = " -prof perfnorm"
@@ -124,7 +125,7 @@ commands += Command.custom((s: State) => Command.applyEffect(profParser(s))((lin
124
125
val commands : List [String ] = profs.flatMap { (prof : Profiler ) =>
125
126
val outDir = file(s " target/profile- ${prof.name}" )
126
127
IO .createDirectory(outDir)
127
- List (line + " " + prof.command(outDir) + s " -o ${(outDir / " jmh.log" ).getAbsolutePath} -rf json -rff ${(outDir / " result.json" ).getAbsolutePath}" , BasicCommandStrings .FailureWall )
128
+ List (line + " -jvmArgs -Dsun.reflect.inflationThreshold=0 " + prof.command(outDir) + s " -o ${(outDir / " jmh.log" ).getAbsolutePath} -rf json -rff ${(outDir / " result.json" ).getAbsolutePath}" , BasicCommandStrings .FailureWall )
128
129
}
129
130
s.copy(remainingCommands = BasicCommandStrings .ClearOnFailure :: commands ++ s.remainingCommands)
130
131
}))
0 commit comments