23.12 sort/parallelSort Timings with the Java SE 8 Date/Time API
In Section 7.15, we used class Arrays
’s static
method sort
to sort an array and we introduced static
method parallelSort
for sorting large arrays more efficiently on multicore systems. Figure 23.28 uses both methods to sort 15,000,000 element arrays of random int
values so that we can demonstrate parallelSort
’s performance improvement of over sort
on a multi-core system (we ran this on a dual-core system).
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.