Would Stream.toList() perform better than Collectors.toList()
问题 JDK is introducing an API Stream.toList() with JDK-8180352. Here is a benchmarking code that I have attempted to compare its performance with the existing Collectors.toList : @BenchmarkMode(Mode.All) @Fork(1) @State(Scope.Thread) @Warmup(iterations = 20, time = 1, batchSize = 10000) @Measurement(iterations = 20, time = 1, batchSize = 10000) public class CollectorsVsStreamToList { @Benchmark public List<Integer> viaCollectors() { return IntStream.range(1, 1000).boxed().collect(Collectors