Are you ready: Java8 Parallel Streams
Java8 Parallel Streams Recently found great article on when to use Parallel Stream by Doug lea and team. In this blog i will share some performance result of different data structure. Splittable data structure This is one of the most important factor that needs to be consider. All the parallel stream operation are executed using default fork join pool and fork join pool uses Divide and conquer algorithms to split stream in small chunks and apply function on small chunks, so splitting is important factor and if splitting is going to take more time then all computation is going to choke! Types of datastructure -Array Array based data structure are most efficient data structure from splitting perspective because each element can be randomly accessed , so splitting is very quick operation. Some of the example of array based collections are ArrayList & open addressing based Set/Map. -Tree Balanced tree based collection like TreeMap or ConcurrentHashMap .Read full article from Are you ready: Java8 Parallel Streams
No comments:
Post a Comment