UP | HOME
2015-11-18 | ../../ | Slides

Java8 Parallel Streams

1 Parallelization

  1. Java SE fork/join Framework
  2. DIY parallel operations: thread-safety issues (thread interference or memory consistency errors)
  3. Locks and Synchronization introduce thread contention.
  4. Java 8 parallel streams provide reliable parallelization into sub-tasks.
  5. Uses multi-core processors

2 Parallel Streams

  1. Discuss the example in the Oracle.com Parallelism link below.

3 Total Amount of Computing Time

  1. Parallelization cuts down on "elapsed" time.
  2. Suppose some computation C takes T units of time.
  3. Perfectly parallelized C with N cores should take T/N.
  4. Total (added across all cores) = T/N * N + overhead

3.1 Performance Measurement

  1. nanoTime() is a basic tool
  2. JIT (just in time) compilation, small sizes of data can contribute to inaccurate measurements.
  3. Recommended is JMH http://openjdk.java.net/projects/code-tools/jmh/

4 Reference

  1. Oracle.com, Parallelism, 2015. Required Reading.

Copyright © 2015 www.wright.edu/~pmateti