[PATCH] D54442: [llvm-exegesis] Optimize ToProcess in dbScan
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 12 13:40:16 PST 2018
MaskRay marked an inline comment as done.
MaskRay added inline comments.
================
Comment at: tools/llvm-exegesis/lib/Clustering.cpp:134-135
// Retrieve a point from the set.
- const size_t Q = *ToProcess.begin();
- ToProcess.erase(Q);
+ size_t Q = ToProcess.back();
+ ToProcess.pop_back();
----------------
lebedev.ri wrote:
> I did try this, at different stages of the patchset.
> It always measured to be slower than deque + pop front.
I moved the vector definition outside to avoid construction/destruction.
`Added` is not really necessary but it is faster than doing two checks: if an element is either Undef or Noise.
Repository:
rL LLVM
https://reviews.llvm.org/D54442
More information about the llvm-commits
mailing list