|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.skeet.jbench.tasks.SimpleTask | +--uk.org.skeet.jbench.tasks.ReflectionTask
Class to test reflection speed. Currently only three types of test are supported: "normal" (no reflection), "invoke" (find the method beforehand, just invoke it within the loop), and "full" (find the method within the loop, once per invocation (ie twice per time round the loop)).
The arguments passed to Class.getMethod and Method.invoke are only created once in the reflection tests, to discover the overhead of just the reflection invocation itself - a fuller test may wish to go through the "pain" of creating these each time for a more realistic test of more usual application use.
The method invoked uses boxing/unboxing (int<->Integer) but has no return value - obviously these factors may also change the speed.
Constructor Summary | |
ReflectionTask()
|
Method Summary | |
void |
checkConfiguration()
Checks that we have a positive size |
void |
checkResults()
Simple no-op implementation of checkResults. |
java.lang.String |
getDescription()
Default description which gives the name of the actual class and the number of iterations. |
void |
incrementCounter(int amount)
Increments the counter by the set amount |
void |
prepareTest()
Simple no-op implementation of prepareTest. |
void |
runTest()
Runs a test. |
void |
setType(java.lang.String type)
Sets the type of test |
Methods inherited from class uk.org.skeet.jbench.tasks.SimpleTask |
getSize, setSize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReflectionTask()
Method Detail |
public void setType(java.lang.String type)
public void runTest() throws TaskException
BenchTask
BenchTask.runTest()
public void checkConfiguration() throws ConfigurationException
SimpleTask
checkConfiguration
in class SimpleTask
SimpleTask.checkConfiguration()
public void prepareTest() throws TaskException
SimpleTask
prepareTest
in class SimpleTask
SimpleTask.prepareTest()
public java.lang.String getDescription()
SimpleTask
getDescription
in class SimpleTask
SimpleTask.getDescription()
public void incrementCounter(int amount)
public void checkResults() throws TaskException
SimpleTask
checkResults
in class SimpleTask
SimpleTask.checkResults()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |