This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static java.util.concurrent.TimeUnit.*; | |
| import static java.util.stream.Collectors.*; | |
| import java.util.*; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.annotations.*; | |
| @Warmup(iterations = 5, time = 1, timeUnit = SECONDS) | |
| @Measurement(iterations = 15, time = 1, timeUnit = SECONDS) | |
| @BenchmarkMode(Mode.AverageTime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.util.stream.*; | |
| import java.util.concurrent.TimeUnit; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.annotations.*; | |
| @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) | |
| @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) | |
| @BenchmarkMode(Mode.AverageTime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Spliterator; | |
| import java.util.Objects; | |
| import java.util.function.Consumer; | |
| class ConstantSpliterator<T> implements Spliterator<T> { | |
| long remaining; | |
| T value; | |
| public ConstantSpliterator(long remaining, T value) { | |
| this.remaining = remaining; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.sample; | |
| import java.util.concurrent.TimeUnit; | |
| import java.util.stream.*; | |
| import java.util.function.*; | |
| import java.util.*; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.annotations.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.util.stream.*; | |
| import static java.util.stream.Collectors.*; | |
| import java.util.concurrent.TimeUnit; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.annotations.*; | |
| @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) | |
| @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.sample; | |
| import java.util.*; | |
| import java.util.concurrent.TimeUnit; | |
| import java.util.stream.*; | |
| import java.util.function.*; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.annotations.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.TimeUnit; | |
| import java.util.stream.*; | |
| import java.util.*; | |
| import java.nio.*; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.annotations.*; | |
| @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) | |
| @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Arrays; | |
| import java.util.concurrent.atomic.AtomicInteger; | |
| import java.util.stream.IntStream; | |
| public class ShortCircuitTest { | |
| static class IntShortCircuitException extends RuntimeException { | |
| int payload; | |
| public IntShortCircuitException(int payload) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.TimeUnit; | |
| import javax.util.streamex.*; | |
| import java.util.stream.*; | |
| import java.util.function.*; | |
| import java.util.*; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.annotations.*; | |
| @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.math.BigDecimal; | |
| import java.util.concurrent.TimeUnit; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.annotations.*; | |
| @Warmup(iterations = 5, time = 3, timeUnit = TimeUnit.SECONDS) | |
| @Measurement(iterations = 10, time = 3, timeUnit = TimeUnit.SECONDS) | |
| @BenchmarkMode(Mode.AverageTime) | |
| @OutputTimeUnit(TimeUnit.MILLISECONDS) |