changeset 202:01fe2ffe529a

Switch to Knuth's MMIX generator for sampling.
author shade
date Mon, 14 Oct 2013 16:47:30 +0400
parents 9954a543d607
children 7c6a0ca567b3
files jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Wed Oct 09 15:51:15 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Mon Oct 14 16:47:30 2013 +0400
@@ -942,7 +942,7 @@
 
             invocationProlog(writer, 4, method, states, true);
 
-            writer.println("            rnd = (rnd * 0x5DEECE66DL + 0xBL) & (0xFFFFFFFFFFFFL);");
+            writer.println("            rnd = rnd * 6364136223846793005L + 1442695040888963407L;");
             writer.println("            boolean sample = (rnd & rndMask) == 0;");
             writer.println("            if (sample) {");
             writer.println("                time = System.nanoTime();");
@@ -951,9 +951,7 @@
             writer.println("            if (sample) {");
             writer.println("                boolean flipped = buffer.add(System.nanoTime() - time);");
             writer.println("                if (flipped) {");
-            writer.println("                    if (rndMask != 0xFFFFFFFFFFFFL) {");
-            writer.println("                        rndMask = (rndMask << 1) + 1;");
-            writer.println("                    }");
+            writer.println("                    rndMask = (rndMask << 1) + 1;");
             writer.println("                }");
             writer.println("            }");