benchmarks/OverloadedMethods2.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 16 Jan 2013 22:06:41 +0000
branchrefactoring-vmdata
changeset 1977 526315e0a801
parent 1818 2e5ed72e7dfd
child 2014 9fa66342102b
permissions -rw-r--r--
Fixed JavaNativeMethodImpl_OpenJDK6 class>>invoke:receiver:arguments:context:constructor:

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

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


!OverloadedMethods2 methodsFor:'running'!

doSmth_1: i
   ^self

!

doSmth_2:f
   ^self

!

doSmth_3:c
   ^self

!

doSmth_4:f
   ^self

!

doSmth_5:f
   ^self

!

doSmth_6:f
   ^self

!

doSmth_7:f
   ^self

!

doSmth_8:f
   ^self

!

doSmth_9:f
   ^self

!

runBenchmarkS2J:n 
    | inst  o |

    inst := JAVA stx libjava benchmarks OverloadedMethods2 new.
    o := JAVA java lang Object new.
    ^ Time 
        millisecondsToRun:[
            1 to:n do:[:idx | 
                inst doSmth:0.
                inst doSmth:''.
                inst doSmth:o.
                inst doSmth:$c.
                inst doSmth:1.
                inst doSmth:false
            ].
        ].

    "Created: / 31-10-2012 / 23:37:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

runBenchmarkS:n 
    | inst o |

    inst := self class new.
    o := Object new.        
    ^ Time 
        millisecondsToRun:[
            1 to:n do:[:idx | 
                inst doSmth_1:0.
                inst doSmth_2:1.23345.
                inst doSmth_4:o.
                inst doSmth_5:''.
                inst doSmth_6:$c.
                inst doSmth_7:1.
                inst doSmth_8:1.
                inst doSmth_9:false.
            ].
        ].

    "Modified: / 04-11-2012 / 21:46:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!OverloadedMethods2 class methodsFor:'documentation'!

version_SVN
    ^ '$Id::                                                                                                                        $'
! !