Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Consider using of tzcnt instruction for better performance in foreach loop and iterator of bitsets #11418
This instruction has a low latency and throughput on most contemporary CPUs.
Also it is implemented as intrinsic and turned on by default in JDK 8:
Below is a snippet how it can be used:
Inspired by the Daniel Lemire's blog post.