private static final double calculateScaleFactor() {
    // Run this simple test to get some sort of performance scaling factor, compared to the
    // development environment. This should help reduce false-positives
    // on this test.
    int numLoops = 10000;

    long start = BaseTestCase.currentTimeMillis();

    for (int j = 0; j < 2000; j++) {
      // StringBuffer below is used for measuring and can't be changed to StringBuilder.
      StringBuffer buf = new StringBuffer(numLoops);

      for (int i = 0; i < numLoops; i++) {
        buf.append('a');
      }
    }

    long elapsedTime = BaseTestCase.currentTimeMillis() - start;
    return elapsedTime / ORIGINAL_LOOP_TIME_MS;
  }