Created
February 1, 2012 12:13
-
-
Save melix/1716776 to your computer and use it in GitHub Desktop.
Proxy generation benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Foo {} | |
abstract class AbstractFoo {} | |
abstract class SingleAbstract { abstract int foo() } | |
def tests = [ | |
'mapAsAbstractClass': { [:] as AbstractFoo }, | |
'mapWithOneMethodAsAbstractClass': { ['foo': { 1 } ] as SingleAbstract } | |
] | |
tests.each { name, test -> | |
long sd = System.currentTimeMillis() | |
1000.times { test() } | |
long dur = System.currentTimeMillis()-sd | |
println "$name: ${dur}ms" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment