LCG Performance

The following are the results of a performance test performed against
LCGs, direct function calls, and reflection API invokes.  Each
test ran for a number of iterations and produced a mean average time in
milliseconds. 

The efficiency of the dynamic method delegate (LCGs) calls are
calculated as the direct method call time divided by the DMD time.
The efficiency of the reflection API Method.Invoke calls are calculated
as the direct method call time divided by the reflection API Invoke
time.


== Testing performance of dynamic method delegates:
== Test call type: static method with boxing on return value
Results for 5 tests on 500000 iterations:
Direct method call: 6ms
Dynamic method delegates: 39ms (Efficiency: 0,15)
MethodInfo.Invoke: 4616ms (Efficiency: 0,001)

== Testing performance of dynamic method delegates:
== Test call type: static method without boxing on return value
Results for 5 tests on 100000 iterations:
Direct method call: 8ms
Dynamic method delegates: 14ms (Efficiency: 0,57)
MethodInfo.Invoke: 894ms (Efficiency: 0,009)

== Testing performance of dynamic method delegates
== Test call type: virtual method without boxing on return value
Results for 5 tests on 10000 iterations:
Direct method call: 10ms
Dynamic method delegates: 13ms (Efficiency: 0,77)
MethodInfo.Invoke: 166ms (Efficiency: 0,06)


Results obtained from Alessandro Febretti in an article at CodeProject.

One thought on “LCG Performance

  1. keyword generation tool

    Took me time to read all the comments, but I actually loved the article. It proved to be very useful to me and I am positive to all the commenters right here as well! It’s all the time nice when you can’t solely learn, but also entertained! I’m certain you had fun writing this blog.

Comments are closed.