The developer of the 4X strategy game The Great Tribes conducted performance tests on three different algorithms for procedural resource generation. The study involved 225 measurements performed on three computers equipped with AMD Ryzen processors.

The game uses Java with the LWJGL library to manage large maps consisting of hundreds of thousands of cells. The resource generation task requires selecting a specific number of candidates based on weighted probability without replacement.

The team compared a sequential approach, a parallel implementation with manual array chunking, and a parallel approach using the Java Stream API collect method. The manual chunking method proved faster in most tests.

The manual parallel implementation divides the cell array based on the number of available logical processors. Each task maintains its own PriorityQueue of the top K candidates, which are merged after processing.

The Stream API approach, while more compact, involves automatic task splitting and result merging. Despite the convenience of the code, it showed lower performance compared to the manual chunking strategy in the majority of the conducted measurements.