Compilation

It is sufficient to build, test and benchmark the library as follows
for basic performance. The library will be compiled to use broadword
implementation of rank & select, which has reasonable performance.

stack build
stack test
stack bench

For best performance, add the bmi2 and avx2 flag to target the BMI2 and AVS2 instruction sets:

Benchmark results

The following benchmark shows the kinds of performance gain that can
be expected from enabling the BMI2 instruction set for CPU targets
that support them. Benchmarks were run on 2.9 GHz Intel Core i7,
macOS High Sierra.