Force a garbage collect after each run of classreader benchmark.
Classes read are garbage anyway and this avoids GC routines to
garble profiling results.
--- a/.hgignore Fri Aug 01 14:25:45 2014 +0100
+++ b/.hgignore Fri Aug 01 14:27:48 2014 +0100
@@ -59,5 +59,8 @@
# Testrunner output files
stx_libjava*-Test.xml
+# Callgrind profile dumps
+callgrind.out.*
+
# Eclipse metadata
.metadata
--- a/benchmarks/JavaBenchmarkClassReader.st Fri Aug 01 14:25:45 2014 +0100
+++ b/benchmarks/JavaBenchmarkClassReader.st Fri Aug 01 14:27:48 2014 +0100
@@ -41,7 +41,7 @@
"
100 timesRepeat:[
- classfiles1 do:[:each |
+ classfiles1 do:[:each |
JavaClassReader readStream: each readStream
].
]
@@ -56,10 +56,10 @@
"
Reads set of classes which contains smalltalk extensions. Most of the time is spent
in compiling an installing those extension methods
- "
+ "
200 timesRepeat:[
- classfiles2 do:[:each |
+ classfiles2 do:[:each |
JavaClassReader readStream: each readStream
].
]
@@ -73,10 +73,10 @@
"
Reads set of classes which contain no extensions nor native methods. This is the most
common case
- "
+ "
200 timesRepeat:[
- classfiles3 do:[:each |
+ classfiles3 do:[:each |
JavaClassReader readStream: each readStream
].
]
@@ -87,7 +87,7 @@
benchmarkReadGroovyJar
"/ Does not work, contains some classes that requires ant to be loaded, sigh
"/ <benchmark: 'Read groovy-all-X.Y.jar'>
-
+
JavaVM loadClassesIn:groovy_all_X_Y_dot_jar
"Created: / 21-05-2014 / 11:29:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -119,8 +119,11 @@
].
].
].
+ JavaVM reboot.
+ ] ifFalse:[
+ JavaVM boot.
].
- JavaVM reboot.
+
bundle := (Smalltalk at:#'stx_libjava') javaBundle.
lib := bundle allLibraries detect:[:each | each name startsWith: 'groovy-all' ] ifNone:[ self error: 'Cannot find Groovy .jar' ].
@@ -136,7 +139,7 @@
lib := bundle allLibraries detect:[:each | each name startsWith: 'rt.jar' ] ifNone:[ self error: 'Cannot find rt.jar' ].
rt_dot_jar := lib classes.
- archive := ZipArchive oldFileNamed: rt_dot_jar.
+ archive := ZipArchive oldFileNamed: rt_dot_jar.
classfiles1 := #(
'java/lang/Object.class'
'java/lang/String.class'
@@ -168,6 +171,7 @@
booted ifFalse:[
Java flushAllJavaResources.
].
+ ObjectMemory garbageCollect.
"Created: / 21-05-2014 / 11:29:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !