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

  • Home
  • SEARCH
  • 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 7089113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:52:57+00:00 2026-05-28T07:52:57+00:00

Why isn’t Byte the default backing type for enumerations? Int32 seems like overkill. Every

  • 0

Why isn’t Byte the default backing type for enumerations?

Int32 seems like overkill. Every Enum I have ever used has contained under 20 values. It’s a micro-optimization, but it seems as though all common usages have under 256 values [in my limited experience].

Is there a more technical reason, or is just to make sure “all common” scenarios of Enum usage work fine and Int32 isn’t really that expensive in all but the corner cases?

In addition I have gotten the implication the compiler does not change the backing type (or no one has mentioned that it optimizes enumerations in what I’ve read). Does it optimize the backing type since it knows the range of values at compile time?

  • 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-28T07:52:58+00:00Added an answer on May 28, 2026 at 7:52 am

    Because the x86 instruction set supports int32 operations natively. There is no performance gain when using int8 operands. Also are memory accesses to operands that are naturally aligned (32bit on a address divisible by 32) carried out faster than if a sub-word has to be shuffled first.

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

Sidebar

Related Questions

Why isn't Collection.remove(Object o) generic? Seems like Collection<E> could have boolean remove(E o); Then,
Isn't every language compiled into low-level computer language? If so, shouldn't all languages have
Why isn't the function with fadeOut ever being reached? Every time the function runs
Isn't it true that every assert statement can be translated to an Assert.IsTrue, since
Isn't JavaScript enabled in all webbrowsers by default? if yes, does this mean that
Isn't it much more elegant and neat to have an IStringable interface? Who needs
Isn't UIButton supposed to become grayish/grayer when enabled=NO ? I have a simple UIButton
Isn't there any way to find the class-type of a generic? if (T instanceof
Why isn't the jQuery changing the type attribute of #password_input to password? <html> <head>
Why isn't this working? ---HTML-------- <html> <head> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js></script> <script type=text/javascript src=j.js></script> </head>

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.