Initially this was D54418 "[llvm-exegesis] InstructionBenchmarkClustering::dbScan(): replace SetVector with custom BitVectorVector"
but the review was strongly negative about having an abstraction for this. Also, @MaskRay has suggested in D54418/D54442
that plain std::vector<char> may be better than llvm::BitVector here, at the cost of more memory usage.
Old: (D54415)
Performance counter stats for './bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html' (16 runs): 6169.091472 task-clock (msec) # 1.000 CPUs utilized ( +- 0.26% ) ... 6.1713 +- 0.0160 seconds time elapsed ( +- 0.26% )
Old: (D54445)
Performance counter stats for './bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html' (16 runs): 5612.071736 task-clock (msec) # 1.000 CPUs utilized ( +- 0.16% ) ... 5.61284 +- 0.00896 seconds time elapsed ( +- 0.16% )
New:
Performance counter stats for './bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html' (16 runs): 5455.563761 task-clock (msec) # 1.000 CPUs utilized ( +- 0.28% ) ... 5.4569 +- 0.0155 seconds time elapsed ( +- 0.28% )
So this is -11.5% as compared to D54415, or -3% as compared to BitVector/D54445
There is basically just one interesting point here, as of now.
Each time we do pop_front (until there is something to pop), we remove from set too.
So when the vector is empty, the set is empty too.
So we don't need to zero-init the set.