Skip to main content
This is lesson 5 of 11 in this module Course 95% complete

Demo: Benchmarking Class Instantiation

Premium Content

Sign in with your account or sign up to access this lesson.

We compare direct instantiation, dynamic method instantiation, and Activator.CreateInstance instantiation for constructing a StringBuilder and demonstrate that dynamic methods are 2x faster than reflection. The lesson discusses the setup cost of building the dynamic method, mentions serialization libraries as a real-world use case, and provides a summary of meta-programming possibilities.