Performance of default Spliterators
Paul Sandoz
paul.sandoz at oracle.com
Fri May 10 02:02:16 PDT 2013
Hi Donald,
I dunno if you work from the lambda source; attached is a patch implementing the random access list spliterator. If you don't work from source, you could copy the spliterator and explicitly hook it up using the constructors in StreamSupport to see if the performance improves.
Also, what terminal operation are you using for the JDK test code? collect(toList()) ?
Paul.
-------------- next part --------------
On May 10, 2013, at 3:28 AM, "Raab, Donald [Tech]" <Donald.Raab at gs.com> wrote:
> Here are some performance tests I was trying out tonight with GSC. The results here are for filtering a list of size 1 million 3 times with different predicates on a 2 core Windows machine. The tests here were warmed up 100 times then executed 200 times so a human doesn't mind waiting. The result of the tests for JDK-Parallel were significantly different enough for me to notice so I started digging into the implementation details a bit.
>
> FastList is our mutable RandomAccess List which is getting the IteratorSpliterator for JDK-Parallel.
>
> **JDK-Serial Filter: FastList size: 1,000,000 Count: 200 Total(ms): 17,735 Avg(ms): 88.679
> GSC-Serial** Select: FastList size: 1,000,000 Count: 200 Total(ms): 12,754 Avg(ms): 63.771
>
> JDK-Parallel Filter: FastList size: 1,000,000 Count: 200 Total(ms): 23,415 Avg(ms): 117.076
> GSC-Parallel Select: FastList size: 1,000,000 Count: 200 Total(ms): 7,121 Avg(ms): 35.607
> GSC-ForkJoin Select: FastList size: 1,000,000 Count: 200 Total(ms): 6,524 Avg(ms): 32.62
>
> Compared to java.util.ArrayList which had a much better JDK-Parallel result because of the specialized override.
>
> **JDK-Serial Filter: ArrayList size: 1,000,000 Count: 200 Total(ms): 14,019 Avg(ms): 70.097
> GSC-Serial** Select: ArrayList size: 1,000,000 Count: 200 Total(ms): 12,398 Avg(ms): 61.99
>
> JDK-Parallel Filter: ArrayList size: 1,000,000 Count: 200 Total(ms): 7,591 Avg(ms): 37.959
> GSC-ForkJoin Select: ArrayList size: 1,000,000 Count: 200 Total(ms): 6,612 Avg(ms): 33.064
> GSC-Parallel Select: ArrayList size: 1,000,000 Count: 200 Total(ms): 6,638 Avg(ms): 33.195
More information about the lambda-libs-spec-observers
mailing list