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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:31:05+00:00 2026-06-05T16:31:05+00:00

I am working on an application where I have to keep data sequenced, every

  • 0

I am working on an application where I have to keep data sequenced, every unit of data comes with a sequence number where, I check if the sequence number is 1 greater than the previous one, if it is, I increase my received count by 1. My question is, Is there a difference between :
1. in increasing my received count by one.
AND
2. assigning the last received sequence number to received count.

Thanks.

  • 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-05T16:31:07+00:00Added an answer on June 5, 2026 at 4:31 pm

    It sounds like a classic premature optimization question to me. Generally increasing value would mean “fetch original->change->store”, while assigning would be “fetch other->store new”. The “other” would probably be fetched already, thus saving even more clock cycles. Thus assigning would probably be faster.

    BUT increment by 1 is usually very well optimized by the compilers and CPU’s so that it wouldn’t require any fetching or storing. It can very well be done in one CPU command, thus eliminating any difference, and in fact making increment by 1 probably better option performance-wise.

    Confused? Good.

    Point is that this is the kind of optimization you should not be doing, unless you benchmarked a bottle neck. Then you benchmark the options and chose the best.

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

Sidebar

Related Questions

I am working in ASP.NET Dynamic Data web application and have an issue of
I have a working application using python and zeromq and I would like to
I am working on an application an have an issue about running shell command
I am new to wpf and i am working on first application i have
I am working on splitting out an existing, working application that I currently have
I have an application I have been working on and it can be slow
I'm working on an application that will have attachments, and I would like to
I'm working on an application so i have write an dll which contain a
I am working on an application where we have 100 of jobs that's needs
Now that I have a read-only application working, I am working on the insert

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.