GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Disable assertion by default in JMH tests (#14878) · netty/netty@be8c9f2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • microbench/src/main/java/io/netty/microbench
    • buffer
      • AdaptiveByteBufAllocatorConcurrentNoCacheBenchmark.java
    • concurrent
      • FastThreadLocalSlowPathBenchmark.java
    • util
      • AbstractMicrobenchmark.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎microbench/src/main/java/io/netty/microbench/buffer/AdaptiveByteBufAllocatorConcurrentNoCacheBenchmark.java‎

Copy file name to clipboardExpand all lines: microbench/src/main/java/io/netty/microbench/buffer/AdaptiveByteBufAllocatorConcurrentNoCacheBenchmark.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class AdaptiveByteBufAllocatorConcurrentNoCacheBenchmark extends Abstract
4444
private int size;
4545

4646
public AdaptiveByteBufAllocatorConcurrentNoCacheBenchmark() {
47-
super(false, true);
47+
super(true, true);
4848
}
4949

5050
@Benchmark
Collapse file

‎microbench/src/main/java/io/netty/microbench/concurrent/FastThreadLocalSlowPathBenchmark.java‎

Copy file name to clipboardExpand all lines: microbench/src/main/java/io/netty/microbench/concurrent/FastThreadLocalSlowPathBenchmark.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected Integer initialValue() {
5757
}
5858

5959
public FastThreadLocalSlowPathBenchmark() {
60-
super(false, true);
60+
super(true, true);
6161
}
6262

6363
@Benchmark
Collapse file

‎microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmark.java‎

Copy file name to clipboardExpand all lines: microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmark.java
+20-1Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,31 @@ public void execute(Runnable command) {
106106

107107
private final String[] jvmArgs;
108108

109+
/**
110+
* Default settings:
111+
* <br>
112+
* Disable assertion in package: {@code io.netty.*}, except {@code io.netty.microbench.*}.
113+
* <br>
114+
* Use custom {@code HarnessExecutor}.
115+
*/
109116
public AbstractMicrobenchmark() {
110-
this(false, false);
117+
this(true, false);
111118
}
112119

120+
/**
121+
* @param disableAssertions If true, it will disable assertion in package: {@code io.netty.*},
122+
* except {@code io.netty.microbench.*},
123+
* which means package {@code io.netty.microbench.*} always gets assertion enabled.
124+
*/
113125
public AbstractMicrobenchmark(boolean disableAssertions) {
114126
this(disableAssertions, false);
115127
}
116128

129+
/**
130+
* @param disableAssertions If true, it will disable assertion in package: {@code io.netty.*},
131+
* except {@code io.netty.microbench.*},
132+
* which means package {@code io.netty.microbench.*} always gets assertion enabled.
133+
*/
117134
public AbstractMicrobenchmark(boolean disableAssertions, boolean disableHarnessExecutor) {
118135
final List<String> jvmArgs = new ArrayList<String>(Arrays.asList(BASE_JVM_ARGS));
119136
jvmArgs.add("-Xms768m");
@@ -128,6 +145,8 @@ public AbstractMicrobenchmark(boolean disableAssertions, boolean disableHarnessE
128145
}
129146
if (disableAssertions) {
130147
removeAssertions(jvmArgs);
148+
// Enable assertion in 'io.netty.microbench.*' package.
149+
jvmArgs.add("-ea:io.netty.microbench...");
131150
}
132151
this.jvmArgs = jvmArgs.toArray(EmptyArrays.EMPTY_STRINGS);
133152
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.