The FAST Way To Create Instances With Reflection You're Not Using
March 15, 2024
• 732 views
reflection in C#microsoft mvpc# reflection tutorialc# reflectionhow to use reflection in c#c# reflection examplec# reflection explainedreflection in c#reflection c# explaineddotnet reflectionreflection c#csharpbenchmarkdotnetbenchmarking .netsoftware performancebenchmarkdotnet tutorialdotnet performancebenchmarking processbenchmarkingc# benchmarkingbenchmarkdotnet how to usebenchmark dotnethow to use benchmarkdotnetdotnetC#.net
When we're using reflection in C#, we have one really popular way to create instances of objects: Activator.CreateInstance. There's another contender though, and that's Type.InvokeMember. When it comes to reflection, we know that the performance is going to be slower than using ways that are available to us at compile time... but which of these two ways to create object instances is faster?
Better question: What's faster than BOTH of these ways and available to us in DotNet reflection?
