benchmarks/Hash.st
author vranyj1
Thu, 15 Nov 2012 22:10:02 +0000
branchdirectory_structure_refactoring
changeset 1818 2e5ed72e7dfd
parent 1762 src/benchmarks/Hash.st@d67be8cbec02
child 2014 9fa66342102b
permissions -rw-r--r--
Directory structure refactoring (part 2)

"{ Package: 'stx:libjava/benchmarks' }"

JavaBenchmark subclass:#Hash
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Benchmarks-Java-Micro'
!


!Hash methodsFor:'running'!

runBenchmarkS:n 
    | count  table |

    count := 0.
    table := Dictionary new:n + (n // 5).
    ^ Time 
        millisecondsToRun:[
            1 to:n do:[:each | 
                table at:(each printStringRadix:16) put:each
            ].
            1 to:n do:[:each | 
                (table includesKey:(each printStringRadix:10)) ifTrue:[
                    count := count + 1
                ]
            ].
        ].
! !

!Hash class methodsFor:'documentation'!

version_SVN
    ^ '$Id::                                                                                                                        $'
! !