Exemplo n.º 1
0
 @Benchmark
 public void parallel_eager_forkjoin_gsc() {
   MutableMultimap<Alphagram, String> groupBy = FJIterate.groupBy(this.gscWords, Alphagram::new);
   groupBy
       .multiValuesView()
       .select(iterable -> iterable.size() >= SIZE_THRESHOLD)
       .toSortedList(Comparators.<RichIterable<String>>byIntFunction(RichIterable::size))
       .asReversed()
       .collect(iterable -> iterable.size() + ": " + iterable)
       .forEach(Procedures.cast(e -> Assert.assertFalse(e.isEmpty())));
 }
Exemplo n.º 2
0
 @Benchmark
 public void parallel_lazy_gsc() {
   ParallelUnsortedBag<String> parallelUnsortedBag =
       this.gscWords.asParallel(this.executorService, BATCH_SIZE);
   UnsortedBagMultimap<Alphagram, String> groupBy = parallelUnsortedBag.groupBy(Alphagram::new);
   groupBy
       .multiValuesView()
       .select(iterable -> iterable.size() >= SIZE_THRESHOLD)
       .toSortedList(Comparators.<RichIterable<String>>byIntFunction(RichIterable::size))
       .asReversed()
       .collect(iterable -> iterable.size() + ": " + iterable)
       .forEach(Procedures.cast(e -> Assert.assertFalse(e.isEmpty())));
 }
Exemplo n.º 3
0
 @Warmup(iterations = 20)
 @Measurement(iterations = 10)
 @Benchmark
 public void serial_eager_gsc() {
   MutableListMultimap<Alphagram, String> groupBy =
       this.gscWords.groupBy(Alphagram::new, FastListMultimap.newMultimap());
   groupBy
       .multiValuesView()
       .select(iterable -> iterable.size() >= SIZE_THRESHOLD)
       .toSortedList(Comparators.<RichIterable<String>>byIntFunction(RichIterable::size))
       .asReversed()
       .collect(iterable -> iterable.size() + ": " + iterable)
       .forEach(Procedures.cast(e -> Assert.assertFalse(e.isEmpty())));
 }