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 7506937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:23:13+00:00 2026-05-29T22:23:13+00:00

I can’t help but wonder if namespaces or project folder structure effect the performance

  • 0

I can’t help but wonder if namespaces or project folder structure effect the performance of the assembly. My gut says “no, but it may possibly effect compile time”.

Thinking about performance always get’s in the way, especially if you’re a novice. I can’t help it! So, I thought I’d ask my fellow game developers who I respect and admire.

  • 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-29T22:23:14+00:00Added an answer on May 29, 2026 at 10:23 pm

    Everyone has explained how premature optimization is a bad idea (which it is): however I will explain why it actually makes no difference whatsoever (except for cases where you use reflection – more on that later).

    Static Reference In Code

    The CLR (and therefore MSIL – which is what C# compiles to) actually has no notion or concept of namespaces. A type (class, enum, etc.) is referred to by its full name (e.g. System.Runtime.Serialization.ISerializable) and ‘full stops’ are just as opaque (meaningful) as any other character in the name. The whole concept of namespaces is something that C# (or whichever language you are using) provides for you. However, in terms of raw MSIL the type name doesn’t actually matter either.

    In MSIL you never refer to something by its name. Everything in an assembly (dll or exe) has a certain type of handle. For example a type has a TypeHandle and anything contained by a type has a MemberHandle: both are a 32bit integer. So when you call a method you don’t write call <MethodName> on <TypeName> in <Assembly> in MSIL – instead you write call <MethodHandle> on <TypeHandle> in <Assembly>. Therefore getting a type that has 5000 characters in its name takes the same amount of time that one with 5 would. The actual names are stored in a separate place in the assembly: only so that you can use reflection to get them, or for compilers (in other words the names are only stored “for your information”) – this is called the metadata.

    I think there is a way to get ILDASM to give you the raw MSIL – but I am not sure.

    Accessed Using Reflection

    Because you are doing a string comparison between the type name you want and the names available in the assembly it makes a difference: string comparisons are a O(n) operation. However, this time is miniscule compared to the total cost of reflection and is completely negligible (it will make nanoseconds of a difference) – don’t even worry about it.

    Summary

    This is why premature optimization is really bad – you assumed this was a bottleneck where in reality there is no faster or slower way to do it.

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

Sidebar

Related Questions

Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can I have a project that has some parts written in c and other
Can i get the source code for a WAMP stack installer somewhere? Any help
Can anyone help me with an excel formula that groups related rows and creates
Can anyone help me trying to find out why this doesn't work. The brushes
Can anybody help me? What should be the datatype for this type -07:00:00 of
Can you guys help me understand a concept real quick, I'm having trouble understanding
Can somebody point me to a resource that explains how to go about having
Can you cast a List<int> to List<string> somehow? I know I could loop through
can you recommend some good ASP.NET tutorials or a good book? Should I jump

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.