Fracture is a Java library which simplifies multi-core development. Currently, this library is very simple, providing a single public class (com.kccoder.fracture.Fracture) which contains the static methods needed to transform your single-core loops into multi-core loops with minimal effort.
Future releases of Fracture will provide solutions for even more complex situations as well as reveal the objects present 'under-the-hood' to enable custom solutions.
It should be noted that there is overhead associated with using Fracture (synchronization and coordination). So, if solve() executes very quickly or total loop execution is very quick, you will experience very little gain in performance (you might even experience a degradation).
However, for sufficiently lengthy tasks, you should experience a sizable increase in performance. Further examples are included in the distribution (package com.kccoder.fracture.example).
By default Fracture uses all available cores; however, you can configure Fracture to use fewer cores by setting the CoreMode via Fracture.setCoreMode(). The modes available are pretty self explanatory. Future releases will provide more sophisticated (and granular) configuration options.
What's New in This Release: [ read full changelog ]
· Addition of a new algorithm which splits the available data into a reasonable number (100 * (# of cores configured)) of contiguous chunks in an attempt to mitigate synchronization overhead. This algorithm only works on data sets which allow for random access (arrays, Lists which implement java.util.RandomAccess) or the forEach(int start, end, increment) variants.
· Renamed Fracture.forEachSync methods to Fracture.forEachAsynch. Not sure what I was thinking when I named them Sync.
· Addition of rudimentary JUnit test cases.
· Major changes of underlying Fracture objects. These will be made public as the package stabilizes.