[Pkg] The Trunk: KernelTests-ul.233.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Sep 16 18:19:28 UTC 2012


Levente Uzonyi uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-ul.233.mcz

==================== Summary ====================

Name: KernelTests-ul.233
Author: ul
Time: 16 September 2012, 8:17:11.75 pm
UUID: 6a2da463-10c3-7e46-9c87-69204b8d1163
Ancestors: KernelTests-ul.232

Speed-up for CompiledMethodComparisonTest >> #testHash:
- instead of comparing all methods with all other, only compare methods which have the same size and header
- only compare each pair of methods at most once (assuming #= is symmetric)
It now takes less than 30 seconds using the interpreter VM on a 4 years old notebook.
Also added a progress bar and decreased the timeout.

=============== Diff against KernelTests-ul.232 ===============

Item was changed:
  ----- Method: CompiledMethodComparisonTest>>testHash (in category 'tests') -----
  testHash
+ 	<timeout: 120>
+ 	
- 	<timeout: 300> "takes 90 seconds in trunk 4.3 on a 2.2GHz Intel Core i7 MacBook Pro"
  	| ai |
  	ai := CompiledMethod allInstances.
+ 	"We assume here that if two CompiledMethods are equal then they have the same size and header."
+ 	((ai
+ 		groupBy: [ :method | { method size. method header } ]
+ 		having: [ :methods | true ])
+ 		collect: [ :each | each asArray ])
+ 		do: [ :methods |
+ 			1 to: methods size do: [ :i |
+ 				i to: methods size do: [ :j |
+ 					(methods at: i) = (methods at: j) ifTrue: [
+ 						self assert: (methods at: i) hash equals: (methods at: i) hash ] ] ] ]
+ 		displayingProgress: 'Testing hashes'.
+ 	self assert: (ai collect: [ :cm | cm hash ] as: Set) size * 2 >= ai asSet size!
- 	ai do:
- 		[:a|
- 		ai do:
- 			[:b|
- 			a = b ifTrue: [self assert: a hash = b hash]]].
- 	self assert: (ai collect: [:cm| cm hash]) asSet size * 2 >= ai asSet size!



More information about the Packages mailing list