benchmarks/Hash.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 04 Feb 2015 07:56:36 +0000
changeset 3370 0d56a220d44c
parent 3107 d1d41053a1c8
child 3508 622620308fee
permissions -rw-r--r--
Buildfiles: automatically generate calls to ant from makefile to build Java code (if any) For Smalltalk/X packages that have Java code, java-related tagets are automatically generated. This means, there is no longer need to manually update and maintain #additional(Rules|Targets)_(make_dot_proto|bc_dot_mak). These targets are: * java_compile (chained to normal build) * java_clean (changed to target clean) These rules *will* fail if Java code cannot be compiled for whatever reason. Buildfiles in STX:LIBJAVA has been regenerated

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

"{ NameSpace: Smalltalk }"

JavaBenchmark subclass:#Hash
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Benchmarks-Java-Obsolete-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_CVS
    ^ '$Header: /cvs/stx/stx/libjava/benchmarks/Hash.st,v 1.3 2013-09-06 00:41:32 vrany Exp $'
!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ 'Id::                                                                                                                        '
! !