Teste de Performance

Pessoal. Fiz um teste de performance com a execucao da mesma classe com implementacoes diferentes. Gostaria de saber se algem pode me ajudar a analisa-lo. Brigado.

C:\>java -Xprof Teste
aqui: 10
teste II

Flat profile of 0.30 secs (19 total ticks): main

  Interpreted + native   Method
 11.1%     1  +     1    sun.nio.cs.UTF_8$Decoder.decodeArrayLoop
 11.1%     0  +     2    java.util.zip.ZipFile.open
 11.1%     0  +     2    java.lang.ClassLoader.defineClass0
 11.1%     1  +     1    java.util.jar.Attributes$Name.isValid
  5.6%     0  +     1    java.io.FileOutputStream.writeBytes
  5.6%     0  +     1    factory.Factory.getInterface
  5.6%     0  +     1    java.io.FileInputStream.open
  5.6%     0  +     1    java.lang.String.intern
  5.6%     1  +     0    java.util.HashMap.addEntry
  5.6%     0  +     1    java.lang.StringCoding$CharsetSD.decode
  5.6%     1  +     0    java.util.HashMap.put
  5.6%     1  +     0    java.util.jar.JarFile.hasClassPathAttribute
  5.6%     0  +     1    java.util.zip.ZipFile.read
 94.4%     5  +    12    Total interpreted

  Thread-local ticks:
  5.3%     1             Blocked (of total)
  5.6%     1             Interpreter


Flat profile of 0.01 secs (1 total ticks): DestroyJavaVM

  Thread-local ticks:
100.0%     1             Blocked (of total)


Global summary of 0.44 seconds:
100.0%    28             Received ticks
 10.7%     3             Compilation
  3.6%     1             Interpreter

C:\>java -Xprof Teste
aqui: 10
teste II

Flat profile of 0.34 secs (20 total ticks): main

  Interpreted + native   Method
 10.0%     0  +     2    java.util.zip.Inflater.init
 10.0%     0  +     2    sun.nio.cs.UTF_8$Decoder.decodeArrayLoop
  5.0%     0  +     1    factory.Factory.getInterface
  5.0%     0  +     1    java.io.FileOutputStream.writeBytes
  5.0%     1  +     0    java.lang.StringCoding.trim
  5.0%     1  +     0    java.nio.CharBuffer.wrap
  5.0%     0  +     1    java.io.WinNTFileSystem.getLastModifiedTime
  5.0%     0  +     1    java.io.WinNTFileSystem.getBooleanAttributes
  5.0%     1  +     0    java.lang.String.lastIndexOf
  5.0%     0  +     1    java.nio.Buffer.<init>
  5.0%     0  +     1    java.lang.String.<init>
  5.0%     0  +     1    java.io.Win32FileSystem.normalize
  5.0%     0  +     1    java.lang.StringCoding.decode
  5.0%     0  +     1    db.types.TypRecLiquid._init_struct
 80.0%     3  +    13    Total interpreted

     Compiled + native   Method
  5.0%     1  +     0    java.lang.CharacterDataLatin1.toLowerCase
  5.0%     1  +     0    Total compiled

  Thread-local ticks:
 10.0%     2             Class loader
  5.0%     1             Interpreter


Flat profile of 0.01 secs (1 total ticks): DestroyJavaVM

  Thread-local ticks:
100.0%     1             Blocked (of total)


Global summary of 0.52 seconds:
100.0%    33             Received ticks
  3.0%     1             Received GC ticks
 18.2%     6             Compilation
  6.1%     2             Class loader
  3.0%     1             Interpreter

Teu teste é rápido demais para ser analisado dessa forma, aumente a carga até o tempo de execução (execução + gc) ser superior a 99%. No teu caso tá próximo dos 75% e isso vai distorcer demais qualquer entendimento.

Desculpe, mas como que você fez essa analise ? Dos 75% ? Eu entendi o que você quis dizer. Coloquei a execução dentro de um contador com um bilhão e deu ai sim um resultado expressivo. num processo de 3,4 seg e no outro 42. So queria entender como vc fez isso e o que quer dizer essas infos todas que aparecem. Grato desde já !