Use vector<char> Added + vector<size_t> ToProcess to replace SetVector ToProcess
We also check Added[P] to enqueueing a point more than once, which
also saves us a ClusterIdForPoint_[Q].isUndef() check.
Differential D54442
[llvm-exegesis] Optimize ToProcess in dbScan MaskRay on Nov 12 2018, 12:56 PM. Authored by
Details
Use vector<char> Added + vector<size_t> ToProcess to replace SetVector ToProcess We also check Added[P] to enqueueing a point more than once, which
Diff Detail
Event Timeline
Comment Actions I've rebased the revision. Old: % perf stat -r 10 ~/llvm/Release/bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/Downloads/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html > /dev/null New: % perf stat -r 10 ~/llvm/Release/bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/Downloads/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html > /dev/null
Comment Actions I don't think we've reached a consensus here. Sorry for missing the ping.
Comment Actions Never mind. Someone asked me for reviews of the llvm-exegesis patch series. I said it wasn't necessarily to be done that way and thus created this one. Later that patch series got accepted and merged and they even mentioned . Yes, I don't understand why that patch series changed the same place back and forth. Comment Actions It looks I missed the unittest, sorry for that. And I somehow messed ToProcess[Tail++] = Q;. The test can be simply repaired. What should I do if I don't agree that an additional abstraction layer should be added?
Comment Actions An abstraction would also be testable independently of the algorithm that uses it, so it might not have had this issue.
Comment Actions @MaskRay, can you help me understand why you decided to submit this when there are still disagreements in the review thread ? Comment Actions Yep, looks stuck. I'm still deeply unhappy with the deeply non-linear performance characteristics Comment Actions What you've reverted is not the version shown in this diff. It included the ideas from Roman. I feel that I should no longer work on this. |
All of this makes the dbscan implementation harder to follow. Please move all this to a separate struct: