[PATCH] D54381: [llvm-exegesis] InstructionBenchmarkClustering::dbScan(): use llvm::SetVector<> instead of ILLEGAL std::unordered_set<>

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 01:45:38 PST 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D54381#1294950, @MaskRay wrote:

> When used to cluster points (measurements) this way with DBSCAN, the order how points are processed does not matter.


Are you implying that it is incorrect to use anything but non-unsorted set here?
I can't just use `DenseSet` here, it ends up begin at least one magnitude slower.
And we most certainly can't keep `std::unordered_set<>`.

> (But I would feel slightly better if the result is deterministic, i.e. `tools/llvm-exegesis/lib/Analysis.cpp#L199` should sort `PointIndices` first).



> I actually think a bitset (`vector<char>` may be better, to track if an element has been inserted)

Yes, that is likely, will investigate.

> + pre-allocated vector (of size of the number of points, used as a stack) is the best. They will be even faster than a `DenseSet<size_t>`.


Repository:
  rL LLVM

https://reviews.llvm.org/D54381





More information about the llvm-commits mailing list