"In my previous article, I took a closer look at the Java ExecutorService interface and its implementations, with some focus on the Fork/Join framework and ThreadPerTaskExecutor. Today, I would like to take a step forward and check how well they behave when put under pressure. In short, I am going to make benchmarks, a lot of benchmarks. All the code from below, and more, will be available in a dedicated GitHub repository."
"Classic Stream Logic public static Map<Ip, Integer> groupByIncomingIp(Stream<String> requests,LocalDateTime upperTimeBound, LocalDateTime lowerTimeBound) {return requests .map(line -> line.split(",")) .filter(words -> words.length == 3) .map(words -> new Request(words[1], LocalDateTime.parse(words[2]))) .filter(request -> request.timestamp().isBefore(upperTimeBound) && request.timestamp().isAfter(lowerTimeBound)) .map(i -> new..."
Benchmarks will evaluate how different ExecutorService implementations perform under pressure. The benchmarking logic is split into classic stream processing and a Fork/Join approach. The classic stream pipeline parses CSV-like request lines, constructs Request objects, filters requests by timestamp bounds, and groups results by incoming IP. The Fork/Join approach applies parallel divide-and-conquer processing to the same problem. All code and variations will be published to a dedicated GitHub repository. The benchmarking effort aims to produce many measurements for comparing throughput, latency, and resource usage across implementations under heavy load.
Read at Medium
Unable to calculate read time
Collection
[
|
...
]