From: kiramt Date: Wed, 20 Sep 2017 10:28:01 +0000 (+0100) Subject: JAL-2662 Adjustments to hidden columns benchmark X-Git-Tag: Release_2_10_3b1~127 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=321dc2877e7da49e61364180a84f353e67982578;p=jalview.git JAL-2662 Adjustments to hidden columns benchmark --- 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