benchmarks/OverloadedMethods.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 11 Feb 2014 15:10:40 +0000
branchdevelopment
changeset 3029 bc928fce0f14
parent 2731 13f5be2bf83b
child 3107 d1d41053a1c8
permissions -rw-r--r--
Merged 6d6f9fd894f7 and c04668cd040d

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

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


!OverloadedMethods methodsFor:'running'!

doSmth_c:c
   ^self

!

doSmth_i: i
   ^self

!

doSmth_o:o
   ^self
   
!

runBenchmarkS2J:n 
    | inst |

    inst := JAVA stx libjava benchmarks OverloadedMethods new.
    ^ Time 
        millisecondsToRun:[
            1 to:n do:[:idx | 
                inst doSmth:0.
                inst doSmth:$c.
                inst doSmth:inst.
            ].
        ].

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

runBenchmarkS:n 
    | inst |

    inst := self class new.
    ^ Time 
        millisecondsToRun:[
            1 to:n do:[:i | 
                inst doSmth_i:0.
                inst doSmth_c:$c.
                inst doSmth_o:inst.
            ]
        ].
! !

!OverloadedMethods class methodsFor:'documentation'!

version_CVS
    ^ '$Header: /cvs/stx/stx/libjava/benchmarks/OverloadedMethods.st,v 1.3 2013-09-06 00:41:33 vrany Exp $'
!

version_HG

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

version_SVN
    ^ 'Id::                                                                                                                        '
! !