title: Java JRE vs GCJ
body: <p>I have this results from a speed test I wrote in Java:</p>
  
  <pre><code>Java
  
  real        0m20.626s
  user        0m20.257s
  sys         0m0.244s
  
  GCJ
  
  real        3m10.567s
  user        3m5.168s
  sys         0m0.676s
  </code></pre>
  
  <p>So, what is the purpose of GCJ then? With this results I'm sure I'm not going to compile it with GCJ!</p>
  
  <p>I tested this on Linux, are the results in Windows maybe better than that?</p>
  
  <p>This was the code from the application:</p>
  
  <pre><code>public static void main(String[] args) {
      String str = "";
      System.out.println("Start!!!");
      for (long i = 0; i &lt; 5000000L; i++) {
          Math.sqrt((double) i);
          Math.pow((double) i, 2.56);
          long j = i * 745L;
          String string = new String(String.valueOf(i));
          string = string.concat(" kaka pipi"); // "Kaka pipi" is a kind of childly call in Dutch. 
          string = new String(string.toUpperCase());
          if (i % 300 == 0) {
              str = "";
          } else {
              str += Long.toHexString(i);
          }
      }
      System.out.println("Stop!!!");
  }
  </code></pre>
  
  <p>I compiled with GCJ like this:</p>
  
  <pre><code>gcj -c -g -O Main.java
  gcj --main=speedtest.Main -o Exec Main.o
  </code></pre>
  
  <p>And ran like this:</p>
  
  <pre><code>time ./Exec                     // For GCJ
  time java -jar SpeedTest.jar    // For Java
  </code></pre>