File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
benchmark/src/jmh/scala/com/thoughtworks/deeplearning/benchmark Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ object benchmark {
42
42
@ State (Scope .Benchmark )
43
43
class FourLayer {
44
44
45
- @ Param (Array (" 4 " ))
45
+ @ Param (Array (" 8 " ))
46
46
protected var batchSize : Int = _
47
47
48
48
@ Param (Array (" 1" , " 2" , " 4" ))
@@ -170,10 +170,15 @@ object benchmark {
170
170
171
171
@ Benchmark
172
172
final def deepLearningDotScala (): Double = {
173
- val (coarseClass, batch) = batches.synchronized {
174
- batches.next()
173
+ try {
174
+ val (coarseClass, batch) = batches.synchronized {
175
+ batches.next()
176
+ }
177
+ model.train(coarseClass, batch).blockingAwait
178
+ } finally {
179
+ System .gc()
180
+ System .gc()
175
181
}
176
- model.train(coarseClass, batch).blockingAwait
177
182
}
178
183
179
184
}
You can’t perform that action at this time.
0 commit comments