From 321dc2877e7da49e61364180a84f353e67982578 Mon Sep 17 00:00:00 2001 From: kiramt Date: Wed, 20 Sep 2017 11:28:01 +0100 Subject: [PATCH] JAL-2662 Adjustments to hidden columns benchmark --- .../java/org/jalview/HiddenColumnsBenchmark.java | 142 ++++++++++++++++---- 1 file changed, 118 insertions(+), 24 deletions(-) diff --git a/benchmarking/src/main/java/org/jalview/HiddenColumnsBenchmark.java b/benchmarking/src/main/java/org/jalview/HiddenColumnsBenchmark.java index 2518494..eb35e3b 100644 --- a/benchmarking/src/main/java/org/jalview/HiddenColumnsBenchmark.java +++ b/benchmarking/src/main/java/org/jalview/HiddenColumnsBenchmark.java @@ -22,57 +22,151 @@ package org.jalview; import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Warmup; import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Param; + +import java.util.ArrayList; +import java.util.List; import java.util.Random; +import java.util.concurrent.TimeUnit; +import jalview.datamodel.ColumnSelection; import jalview.datamodel.HiddenColumns; /* * A class to benchmark hidden columns performance */ +@Warmup(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@Fork(1) public class HiddenColumnsBenchmark -{ +{ + /* + * State with multiple hidden columns and a start position set + */ @State(Scope.Thread) - public static class ThreadState + public static class HiddenColsAndStartState { + @Param({"300", "10000", "100000"}) + public int maxcols; + + @Param({"1", "50", "90"}) + public int startpcnt; // position as percentage of maxcols + + @Param({"1","15","100"}) + public int hide; + HiddenColumns h = new HiddenColumns(); - int MAXCOLS = 100000; Random rand = new Random(); + + public int hiddenColumn; + public int visibleColumn; @Setup public void setup() { rand.setSeed(1234); - for (int i=0; i