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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:05:00+00:00 2026-06-03T09:05:00+00:00

i did some tests with pre- and post-incrementation, to figure if there are performance

  • 0

i did some tests with pre- and post-incrementation, to figure if there are performance or power-consumption differences within the two operators on android.

i did not find any differences.

the basic thesis is well explained here: http://www.roman10.net/pre-increment-and-post-increment/
(pre is faster, because no temp-var is generated).

i learned this for c++, this website shows the c-implementation, but i was not able to figure out, how the implementation is done in android (maybe its different).

the code is used to test is

int lPlotRangeCtr = 0;
    while (lPlotRangeCtr != mPlotRange){
        int lTMP = ++lPlotRangeCtr;
    }   

this is the chunk for pre-increment, the one for post- works similar, as you can imagine.
i used the tamp var “lTMP” to make sure that the return value of the operator is assigned and the compiler does not convert the increment-operator.

so can anybody help me, how to find the implentation.
can the compiler still convert the operator, when its approved, that “lTMP” is never read?
are such statements automatically removed while compiling?

  • 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-03T09:05:01+00:00Added an answer on June 3, 2026 at 9:05 am

    Compilers can be very smart and I wouldn’t be surprised if it optimized the variable right out. I suggest that you make it a global variable and mark it as volatile. This forces the compiler to write to it.

    Having said all that, if you’re worried about the performance of x++ versus ++x then you are likely micromanaging your performance too much. Most performance gains are achieved at higher levels than this and the effect that this change will make on your program will be negligible in all but the most extreme cases.

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

Sidebar

Related Questions

doing this: new WindsorContainer() takes 4 seconds, sometimes 7 I did some performance tests
I did some tests on pow(exponent) method. Unfortunately, my math skills are not strong
I did some tests a while ago and never figured out how to make
I did some tests about IList<T>.Aggregate() , but the answer does not make sense
I did some tests with the operator &= . As the following examples shows,
So i did some tests against Indexing 3 rows vs Unique key for those
I wrote a Google Maps API wrapper in JS, did some local tests with
I did some tests on Chrome and requestAnimationFrame yielded 61 fps while setTimeOut( callback,
I'm making a backup managrer for my App (via iCloud). I did some tests
I did some tests with memory_get_usage and memory_get_peak_usage. One of my scripts returns 1.3mb

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.