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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:44:09+00:00 2026-06-10T01:44:09+00:00

Here I was just writing some code that dealt with an integer value of

  • 0

Here I was just writing some code that dealt with an integer value of -24/+24, and I made my method return an int… And I thought to myself– should I really be using a short in this case? I know it might have mattered back in the day when memory for something was 48k– but in today’s modern world does it really matter?

Is it ok to just be “int happy”, even when I know my numbers are going to be very small?

  • 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-06-10T01:44:10+00:00Added an answer on June 10, 2026 at 1:44 am

    All ARM CPUs have 32-bit integer registers and at least a 32-bit wide L1 bus, so using a short will give absolutely no advantage [1], and may in some cases be detrimental to performance.

    Leave the variable as an int and be safe in the knowledge that you’ll get an optimum register width pretty much wherever you run the code.

    [1] The exception to this rule being when using the NEON unit – in which case a 16-bit operation offers more parallelism than a 32-bit operation.

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

Sidebar

Related Questions

Just putting part of some code here where I am writing two values to
Just some example code here, but I have lists of strings that I want
I have just written some code, which as i was writing i thought, this
I'm writing a game for Android using libgdx. Here is some code that draws
I am writing some jQuery code that involves jumping from several functions. In one
I'm writing some python code to interact with a C DLL that uses structures
I'm writing some code that plays back WAV files at different speeds, so that
I'm looking at writing some code that performs shadow mapping, in DX9. The sample
i'm writing some code that basically receive data from socket, perform deserialization and then
I was just writing some exploratory code to solidify my understanding of Objective-C and

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.