Performance
Performance of delegates used to be much slower than a virtual or interface method call (6 to 8 times slower in Microsoft's 2003 benchmarks), but, since the .NET 2.0 CLR in 2005, it is about the same as interface calls. This means there is a small added overhead compared to direct method invocations.
There are very stringent rules on the construction of delegate classes. These rules permit optimizing compilers a great deal of leeway when optimizing delegates while ensuring type safety.
Delegates are a variation of closures.
Read more about this topic: Delegate (.NET)
Famous quotes containing the word performance:
“Tennis is more than just a sport. Its an art, like the ballet. Or like a performance in the theater. When I step on the court I feel like Anna Pavlova. Or like Adelina Patti. Or even like Sarah Bernhardt. I see the footlights in front of me. I hear the whisperings of the audience. I feel an icy shudder. Win or die! Now or never! Its the crisis of my life.”
—Bill Tilden (18931953)
“What avails it that you are a Christian, if you are not purer than the heathen, if you deny yourself no more, if you are not more religious? I know of many systems of religion esteemed heathenish whose precepts fill the reader with shame, and provoke him to new endeavors, though it be to the performance of rites merely.”
—Henry David Thoreau (18171862)
“Still be kind,
And eke out our performance with your mind.”
—William Shakespeare (15641616)