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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:12:56+00:00 2026-05-29T06:12:56+00:00

I use Java in this question but this really applies to all modern app

  • 0

I use Java in this question but this really applies to all modern app development. Our “environment pipeline”, like many of them, looks like this:

  • Developer sandbox
  • Continuous integration & testing
  • QA/Staging
  • Production

The hardware, available RAM & CPU in each of these environments is different: my laptop is a 2GB dual-core Windows machine. Testing runs on a 4GB machine. Production is two (load-balanced) 8GB, quad-core servers.

Obviously the same code will perform differently when it runs on these different machines (environments).

I was thinking about writing automated performance tests for some of my classes that would be of the form:

private static final long MAX_TIME = 8000;

@Test
public final void perfTestSomething() {
    long start = System.currentTimeInMillis();

    // Run the test

    long end = System.currentTimeInMillis();

    assertTrue((end - start) < MAX_TIME);
}

Thus the automated performance test fails if the test takes more than, say, 8 seconds to run.

But then this realization dawned on me: the code will run different in different environments, and will run differently depending on the state of JVM and GC. I could run the same test 1000 times on my own machine and have wildly different results.

So I ask: how does one accurately/reliably define & gauge automated performance tests as code is promoted from one environment to the next?

Thanks in advance!

  • 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-29T06:12:57+00:00Added an answer on May 29, 2026 at 6:12 am

    It may be that you only want to run the performance tests in a given location that is more tightly controlled. You don’t necessarily need to run them in all environments, there’s little benefit in that. You should run them in an environment that most closely mimics a production configuration (that’s what you REALLY care about, right?).

    Also, make sure you give yourself reasonable overhead in your performance restrictions. Don’t lock them down to just above what your server does NOW. Select some reasonable thresholds to account for some variation in the current run.

    Long term what I’ve found more useful is a graph over time of the performance numbers. Not a hard limit. That way we can watch trending of various functionality over time, and attack it when it trends too high.

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

Sidebar

Related Questions

I will use Java as an example, but this question really applies across all
Sorry for asking this question, but I searched all Java-related questions, but I got
this is just theoretical question. I use JDBC with my Java applications for using
Related to: Query Windows Search from Java But this time to use OSX's spotlight
I use a batch to launch my java application like this start /min java
Is there an openID implementation in Java? I would like to use this in
I know this question might be repeated many times but would really appreciate any
I am new in programming and this question may really be stupid but I
I do like to write really readable code in Java. For that I use
In Java we use System.setProperty() method to set some system properties. According to this

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.