Mercurial > hg > graal-compiler
changeset 19931:b6af1acf00d6
BenchmarkCounters: add option to turn of number grouping separators.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Wed, 18 Mar 2015 11:30:45 +0100 |
parents | 575d7607f827 |
children | bf342f564500 da997cdfb0d8 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java |
diffstat | 1 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Wed Mar 18 02:15:37 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Wed Mar 18 11:30:45 2015 +0100 @@ -85,6 +85,8 @@ " dacapo = 'err, starting =====, PASSED in'%n" + " specjvm2008 = 'out,Iteration ~ (~s) begins:,Iteration ~ (~s) ends:'", type = OptionType.Debug) private static final OptionValue<String> BenchmarkDynamicCounters = new OptionValue<>(null); + @Option(help = "Use grouping separators for number printing", type = OptionType.Debug) + private static final OptionValue<Boolean> DynamicCountersPrintGroupSeparator = new OptionValue<>(true); //@formatter:on } @@ -207,28 +209,29 @@ cnt--; } + String numFmt = Options.DynamicCountersPrintGroupSeparator.getValue() ? "%,19d" : "%19d"; if (staticCounter) { out.println("=========== " + group + " (static counters):"); for (Map.Entry<Long, String> entry : sorted.entrySet()) { long counter = entry.getKey() / array.length; - out.format(Locale.US, "%,19d %3d%% %s\n", counter, percentage(counter, sum), entry.getValue()); + out.format(Locale.US, numFmt + " %3d%% %s\n", counter, percentage(counter, sum), entry.getValue()); } - out.format(Locale.US, "%,19d total\n", sum); + out.format(Locale.US, numFmt + " total\n", sum); } else { if (group.startsWith("~")) { out.println("=========== " + group + " (dynamic counters), time = " + seconds + " s:"); for (Map.Entry<Long, String> entry : sorted.entrySet()) { long counter = entry.getKey() / array.length; - out.format(Locale.US, "%,19d/s %3d%% %s\n", (long) (counter / seconds), percentage(counter, sum), entry.getValue()); + out.format(Locale.US, numFmt + "/s %3d%% %s\n", (long) (counter / seconds), percentage(counter, sum), entry.getValue()); } - out.format(Locale.US, "%,19d/s total\n", (long) (sum / seconds)); + out.format(Locale.US, numFmt + "/s total\n", (long) (sum / seconds)); } else { out.println("=========== " + group + " (dynamic counters):"); for (Map.Entry<Long, String> entry : sorted.entrySet()) { long counter = entry.getKey() / array.length; - out.format(Locale.US, "%,19d %3d%% %s\n", counter, percentage(counter, sum), entry.getValue()); + out.format(Locale.US, numFmt + " %3d%% %s\n", counter, percentage(counter, sum), entry.getValue()); } - out.format(Locale.US, "%,19d total\n", sum); + out.format(Locale.US, numFmt + " total\n", sum); } } }