--- a/benchmarks/CollectionBenchmarks.st Wed Jun 29 21:40:53 2016 +0100
+++ b/benchmarks/CollectionBenchmarks.st Thu Jun 30 09:02:08 2016 +0100
@@ -18,137 +18,137 @@
ObjectMemory garbageCollect.
#(SortedCollection AATree BinaryTree) do:[:className |
- |class doBench coll t seq|
+ |class doBench coll t seq|
- class := Smalltalk classNamed:className.
+ class := Smalltalk classNamed:className.
- doBench := [:class |
- |coll t|
+ doBench := [:class |
+ |coll t|
- t := Time millisecondsToRun:[
- coll := class new.
- randomNumbers do:[:each | coll add:each]
- ].
- Transcript show:'Time to insert random '; show:N; show:' individually into ',class name,': '; show:t; showCR:'ms'.
- coll
- ].
+ t := Time millisecondsToRun:[
+ coll := class new.
+ randomNumbers do:[:each | coll add:each]
+ ].
+ Transcript show:'Time to insert random '; show:N; show:' individually into ',class name,': '; show:t; showCR:'ms'.
+ coll
+ ].
- ObjectMemory garbageCollect.
- doBench value:class.
- ObjectMemory garbageCollect.
+ ObjectMemory garbageCollect.
+ doBench value:class.
+ ObjectMemory garbageCollect.
- doBench := [:class |
- |coll t|
+ doBench := [:class |
+ |coll t|
- t := Time millisecondsToRun:[
- coll := class new.
- coll addAll:randomNumbers
- ].
- Transcript show:'Time to insert random '; show:N; show:' en-bloque into ',class name,': '; show:t; showCR:'ms'.
- coll
- ].
+ t := Time millisecondsToRun:[
+ coll := class new.
+ coll addAll:randomNumbers
+ ].
+ Transcript show:'Time to insert random '; show:N; show:' en-bloque into ',class name,': '; show:t; showCR:'ms'.
+ coll
+ ].
- ObjectMemory garbageCollect.
- doBench value:class.
- ObjectMemory garbageCollect.
+ ObjectMemory garbageCollect.
+ doBench value:class.
+ ObjectMemory garbageCollect.
- doBench := [:class |
- |coll t|
+ doBench := [:class |
+ |coll t|
- t := Time millisecondsToRun:[
- coll := class new.
- (1 to:N) do:[:each | coll add:each].
- ].
- Transcript show:'Time to insert in order '; show:N; show:' individually into ',class name,': '; show:t; showCR:'ms'.
- coll
- ].
+ t := Time millisecondsToRun:[
+ coll := class new.
+ (1 to:N) do:[:each | coll add:each].
+ ].
+ Transcript show:'Time to insert in order '; show:N; show:' individually into ',class name,': '; show:t; showCR:'ms'.
+ coll
+ ].
- ObjectMemory garbageCollect.
- doBench value:class.
- ObjectMemory garbageCollect.
+ ObjectMemory garbageCollect.
+ doBench value:class.
+ ObjectMemory garbageCollect.
- doBench := [:class |
- |coll t|
+ doBench := [:class |
+ |coll t|
- t := Time millisecondsToRun:[
- coll := class new.
- coll addAll:(1 to:N).
- ].
- Transcript show:'Time to insert in order '; show:N; show:' en-bloque into ',class name,': '; show:t; showCR:'ms'.
- coll
- ].
+ t := Time millisecondsToRun:[
+ coll := class new.
+ coll addAll:(1 to:N).
+ ].
+ Transcript show:'Time to insert in order '; show:N; show:' en-bloque into ',class name,': '; show:t; showCR:'ms'.
+ coll
+ ].
- ObjectMemory garbageCollect.
- doBench value:class.
- ObjectMemory garbageCollect.
+ ObjectMemory garbageCollect.
+ doBench value:class.
+ ObjectMemory garbageCollect.
- doBench := [:class |
- |coll t|
+ doBench := [:class |
+ |coll t|
- t := Time millisecondsToRun:[
- coll := class new.
- (N downTo:1) do:[:each | coll add:each].
- ].
- Transcript show:'Time to insert in reverse order '; show:N; show:' individually into ',class name,': '; show:t; showCR:'ms'.
- coll
- ].
+ t := Time millisecondsToRun:[
+ coll := class new.
+ (N downTo:1) do:[:each | coll add:each].
+ ].
+ Transcript show:'Time to insert in reverse order '; show:N; show:' individually into ',class name,': '; show:t; showCR:'ms'.
+ coll
+ ].
- ObjectMemory garbageCollect.
- doBench value:class.
- ObjectMemory garbageCollect.
+ ObjectMemory garbageCollect.
+ doBench value:class.
+ ObjectMemory garbageCollect.
- doBench := [:class |
- |coll t|
+ doBench := [:class |
+ |coll t|
- t := Time millisecondsToRun:[
- coll := class new.
- coll addAll:(N downTo:1).
- ].
- Transcript show:'Time to insert in reverse order '; show:N; show:' en-bloque into ',class name,': '; show:t; showCR:'ms'.
- coll
- ].
+ t := Time millisecondsToRun:[
+ coll := class new.
+ coll addAll:(N downTo:1).
+ ].
+ Transcript show:'Time to insert in reverse order '; show:N; show:' en-bloque into ',class name,': '; show:t; showCR:'ms'.
+ coll
+ ].
- ObjectMemory garbageCollect.
- doBench value:class.
- ObjectMemory garbageCollect.
+ ObjectMemory garbageCollect.
+ doBench value:class.
+ ObjectMemory garbageCollect.
- coll := class new.
- coll addAll:randomNumbers.
+ coll := class new.
+ coll addAll:randomNumbers.
- t := Time millisecondsToRun:[
- coll removeAll:randomNumbers.
- ].
- Transcript show:'Time to remove in random order '; show:N; show:' from ',class name,': '; show:t; showCR:'ms'.
- self assert:(coll isEmpty).
- ObjectMemory garbageCollect.
+ t := Time millisecondsToRun:[
+ coll removeAll:randomNumbers.
+ ].
+ Transcript show:'Time to remove in random order '; show:N; show:' from ',class name,': '; show:t; showCR:'ms'.
+ self assert:(coll isEmpty).
+ ObjectMemory garbageCollect.
- coll := class new.
- coll addAll:randomNumbers.
- seq := randomNumbers copy sort.
+ coll := class new.
+ coll addAll:randomNumbers.
+ seq := randomNumbers copy sort.
- t := Time millisecondsToRun:[
- coll removeAll:seq.
- ].
- Transcript show:'Time to remove in order '; show:N; show:' from ',class name,': '; show:t; showCR:'ms'.
- self assert:(coll isEmpty).
- ObjectMemory garbageCollect.
+ t := Time millisecondsToRun:[
+ coll removeAll:seq.
+ ].
+ Transcript show:'Time to remove in order '; show:N; show:' from ',class name,': '; show:t; showCR:'ms'.
+ self assert:(coll isEmpty).
+ ObjectMemory garbageCollect.
- coll := class new.
- coll addAll:randomNumbers.
- seq := randomNumbers copy sort reverse.
+ coll := class new.
+ coll addAll:randomNumbers.
+ seq := randomNumbers copy sort reverse.
- t := Time millisecondsToRun:[
- coll removeAll:seq.
- ].
- Transcript show:'Time to remove in reverse order '; show:N; show:' from ',class name,': '; show:t; showCR:'ms'.
- self assert:(coll isEmpty).
- ObjectMemory garbageCollect.
+ t := Time millisecondsToRun:[
+ coll removeAll:seq.
+ ].
+ Transcript show:'Time to remove in reverse order '; show:N; show:' from ',class name,': '; show:t; showCR:'ms'.
+ self assert:(coll isEmpty).
+ ObjectMemory garbageCollect.
- Transcript cr.
+ Transcript cr.
].
!
@@ -201,9 +201,9 @@
"/ Transcript showCR:'-----------'.
"/ Transcript showCR:(coll instVarNamed:'treeRoot').
"/ Transcript showCR:each.
- coll remove:each.
- sc remove:each.
- self assert:(sc asOrderedCollection = coll asOrderedCollection).
+ coll remove:each.
+ sc remove:each.
+ self assert:(sc asOrderedCollection = coll asOrderedCollection).
].
! !