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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:57:06+00:00 2026-06-17T23:57:06+00:00

Why groups j=k*l and m=n*o have different performance, while first 3 groups have the

  • 0

Why groups j=k*l and m=n*o have different performance, while first 3 groups have the same ?

int a = 42;
int b = 42;
int c = 42;

Integer d = 42;
int e = 42;
int f = 42;

int g = 42;
Integer h = 42;
int i = 42;

int j = 42;
int k = 42;
Integer l = 42;

Integer m = 42;
Integer n = 42;
Integer o = 42;

for(int z = 0; z < 1000000000; z++){
    // c = a*b; // 630 ms
    // f = d*e; // 630 ms
    // i = g*h; // 630 ms
    // l = j*k; // 6000 ms
    // o = m*n; // 6400 ms
}
  • 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-17T23:57:07+00:00Added an answer on June 17, 2026 at 11:57 pm

    You have a loop which doesn’t do anything useful. As such the JIT can take some time to detect this and eliminate the loop. In the first four examples, the code is taking an average of a fraction of a clock cycle. This is a strong hint that the loop has been optimised away and you are actually measuring how long it takes to detect and replace the loop with nothing,

    In the later examples, the loop is not optimised away because there is something about the loop which the JIT doesn’t eliminate. I suspected it was the object allocation for the Integer but -verbosegc showed that no objects were being created.

    On my machine the loop take about 1.9 ns or about 6 clock cycles which is pretty quick so I am not sure what is left which takes that much time..

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

Sidebar

Related Questions

I have class that represents users. Users are divided into two groups with different
I have a Tridion implementation that is, in essence, multi-tennent. Different interest groups use
I am working on a web application where different user groups have different access
I have 2 different group page with 2 look alike classes which using the
I have several different numbers in a group that range in sizes and would
So I have 2 different group of tags in one post, let's call them
I have 3 tables users(id,name),groups(id,name) and users_groups(user_id,group_id). users and groups have many to many
I have groups of people. I need to move groups with at least one
If I have groups of checkboxes like so: <input type=checkbox namecheckboxes1 value=#value1> <input type=checkbox
I have a table of Groups that have a capacity column and has a

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.