Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6038593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:14:40+00:00 2026-05-23T06:14:40+00:00

I use reflection APIs such as GetType() and GetTypes() in .NET/C#. In terms of

  • 0

I use reflection APIs such as GetType() and GetTypes() in .NET/C#.

  • In terms of performance, how good or bad are those APIs? I mean, are these APIs take much time that might cause some performance degradation, or are these APIs well designed to ignore performance issues?
  • Do normally people caching the results when they use the reflection APIs?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:14:40+00:00Added an answer on May 23, 2026 at 6:14 am

    We don’t know what “good” and “bad” mean to you.

    We don’t know if you are using these in critical performance code that is likely to be a bottleneck to your application.

    Only you know exactly the paths your code will take when using Object.GetType and Assembly.GetTypes.

    Therefore, only you can profile exactly how meaningful the use of these methods will be on the performance of your application, and how beneficial it will be to try to boost the performance through caching.

    I can tell you this: I have never had Type.GetType and Assembly.GetTypes be a bottleneck in my application, and I don’t cache the results (I have, however, needed to cache MemberInfo.GetCustomAttributes but I only came to that conclusion after a profiler told me that it was a significant bottleneck in my application and that caching would substantially improve the performance).

    Responding to your edit:

    I mean, are these APIs take much time that might cause some performance degradation, or are these APIs well designed to ignore performance issues?

    What alternatives do you have? If you need a reference to Type for a given object, or you need all the types in a given assembly, I assure you that Object.GetType and Assembly.GetTypes are your best choice. The question is, how are you using them? Again, we don’t know, and therefore can’t tell you what to do. You have to profile your real-world use of these functions and find out if they are causing a bottleneck in your application or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We know that behind the scenes, the ASP.NET MVC framework will use reflection to
I have a performance problem because I use reflection and GetCustomAttributes for my data
I use reflection find all the Classes in my project that Inherit from Packet.Base
Is it possible to use reflection to know what the code is doing, not
I need to use reflection to get the binding value in a control that
I would imagine this might use Reflection.Emit, but a similar question on SO only
I'd basically like to use reflection in Powershell, and after dynamically finding the methods
In WPF, how do I use reflection to find all classes in a project?
I want to develop a simple orm which performs CRUD functionality.Shold i use reflection?
I was just curious, why should we use reflection in the first place? //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.