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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:18:42+00:00 2026-05-24T04:18:42+00:00

In 10, or even 5 years there will be no [ Edit2: server or

  • 0

In 10, or even 5 years there will be no [Edit2: server or desktop] 32-bit CPUs.

So, are there any advantages in using int (32bit) over long (64bit) ?
And are there any disadvantages in using int ?


Edit:

  1. By 10 or 5 years I meant on vast majority of places where those langs are used

  2. I meant which type to use by default. This days I won’t even bother to think if I should use short as cycle counter, just for(int i.... The same way long counters already win

  3. registers are already 64-bit, there is already no gain in 32 bit types. And I think some loss in 8 bit types (you have to operate on more bits then you’re using)

  • 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-24T04:18:45+00:00Added an answer on May 24, 2026 at 4:18 am

    If you’re on a 64-bit processor, and you’ve compiled your code for 64-bit, then at least some of the time, long is likely to be more efficient because it matches the register size. But whether that will really impact your program much is debatable. Also, if you’re using long all over the place, you’re generally going to use more memory – both on the stack and on the heap – which could negatively impact performance. There are too many variables to know for sure how well your program will perform using long by default instead of int. There are reasons why it could be faster and reasons why it could be slower. It could be a total wash.

    The typical thing to do is to just use int if you don’t care about the size of the integer. If you need a 64-bit integer, then you use long. If you’re trying to use less memory and int is far more than you need, then you use byte or short.

    x86_64 CPUs are going to be designed to be efficient at processing 32-bit programs and so it’s not like using int is going to seriously degrade performance. Some things will be faster due to better alignment when you use 64-bit integers on a 64-bit CPU, but other things will be slower due to the increased memory requirements. And there are probably a variety of other factors involved which could definitely affect performance in either direction.

    If you really want to know which is going to do better for your particular application in your particular environment, you’re going to need to profile it. This is not a case where there is a clear advantage of one over the other.

    Personally, I would advise that you follow the typical route of using int when you don’t care about the size of the integer and to use the other types when you do.

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

Sidebar

Related Questions

Over the years most web developers will have built an arsenal of tools or
Have you ever seen any of there error messages? -- SQL Server 2000 Could
I've been studying C# for a couple of years, reading voraciously, even taking a
I'm familiar with ORM as a concept, and I've even used nHibernate several years
Even before telling my question, will tell you that this is a very vague
I have been using .net for the past couple of years, and I like
The standard will doubtless take years to put in place, which stinks because it
I heard on the grapevine that Microsoft will be releasing SQL Server 2008 R2
I have about 4-6 years .NET experience. Primarly using ASP.NET MVC/Nhibernate/Castle Windsor/MSpec/etc in visual
Fist off, been lurking for years, hopefully this post will be helpful to more

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.