Forums Register Login

What is faster: accessing methods directly or using reflection?

+Pie Number of slices to send: Send
Hi,

I want to know that if i am accessing the methods of a class using Reflection then will it be faster comparatively to accessing methods of that class directly?

I read somewhere, don't remember where that reflection is much faster than accessing things directly. Can any one help me in this regard?
+Pie Number of slices to send: Send
A compiled method call is always going to be MUCH faster than any process using reflection. Just think about the steps involved.
Bill
+Pie Number of slices to send: Send
"Using reflection is basically an interpreted operation, where you tell the JVM what you want to do and it does it for you. This type of operation is always going to be slower than just doing the same operation directly."

Java Programming Dynamics
+Pie Number of slices to send: Send
THanks
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 777 times.
Similar Threads
What exactly the use of an interface other than readability of code?
How to get value?
Passing functions to functions
Your usage of reflection
Which Design pattern to use ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:30:45.