No, these are averages of run time. These are not the upfront costs, but instead the average over 2 million calls or whatever.

For example, if DynamicMethod takes 20000ms upfront (to compile the il, although that seems way too long), it might still be smarter to use the dynamic keyword even in performance critical code.

-[Unknown]


Benji Smith wrote:
Unknown W. Brackets wrote:
I wonder what the overhead times were. He should've timed them both and listed them separately. For example, is DynamicMethod a complete win, or is the dynamic keyword cheaper as far as base cost?

Actually, he does. It's at the bottom of the "second look" post:

  Compile Time Bound: 6 ms
  Dynamically Bound with dynamic keyword: 45ms
  Dynamically Bound with MethodInfo.Invoke - 10943ms
  Dynamically Bound with DynamicMethod - 8ms

--benji

Reply via email to