Parallel optimization of the set data structure
Gustav Karlsson · KTH Publication Database DiVA (KTH Royal Institute of Technology) · 2015
The Set data structure is a powerful and popular programmer’s tool based on set theory. Bulk operations such as addAll provide a simple way of working with big collections of elements but can severely limit the performance of a multi-processor system when invoked on big sets if performed sequentially. Parallel processing is a technique that can significantly shorten the execution time of otherwise sequentially executed tasks. In this thesis, a new type of set is proposed that uses multiple threads to employ parallel processing for bulk operations. A new set is designed based on a non-blocking hash table with a high level of concurrency. The parallelization of the set makes use of parallel Java 8 streams to allow for quick iteration of the source collection elements, resulting in a speedup in processing of bulk operations. Testing the parallel set shows a significant increase in execution speed on bulk operations when operating on more than 10000 elements.