This is interesting - a side-by-side performance comparison of reflection, dynamic, and direct property access.

Reflection is slow – 2000 times slower than direct access – though we all knew that.

Dynamic is also slow, but only 60 times slower than direct access. That’s not too shabby.

Another way to look at it - dynamic is more than 30 times faster than reflection. This more than makes it viable for certain classes of problem.


blog comments powered by Disqus
Next Post
PhpMyAdmin and the White Screen of Death  12 Jul 2009
Prior Post
Older Programmers  07 Jul 2009
Related Posts
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
When are you done?  18 Apr 2022
Fixing GitHub Authentication  28 Nov 2021
July 2009