This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] InstructionBenchmarkClustering::rangeQuery(): reserve for the upper bound of Neighbors
ClosedPublic

Authored by lebedev.ri on Nov 12 2018, 12:07 AM.

Details

Summary

As it was pointed out in D54388+D54390, the maximal size of Neighbors is known,
it will contain at most Points_.size() minus one (the center of the cluster)

While that is the upper bound, meaning in the most cases, the actual count
will be much smaller, since D54390 made the allocation persistent,
we no longer have to worry about overly-optimistically reserve()ing.

Old: (D54393)

 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):

       6553.167456      task-clock (msec)         #    1.000 CPUs utilized            ( +-  0.21% )
...
            6.5547 +- 0.0134 seconds time elapsed  ( +-  0.20% )

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):

       6315.057872      task-clock (msec)         #    0.999 CPUs utilized            ( +-  0.24% )
...
            6.3187 +- 0.0160 seconds time elapsed  ( +-  0.25% )

And that is another -~4%.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.Nov 12 2018, 12:07 AM
MaskRay added inline comments.Nov 12 2018, 12:21 AM
tools/llvm-exegesis/lib/Clustering.cpp
140 ↗(On Diff #173619)

I've lost in the patch series :( I think I understand the DBSCAN implementation well enough now. You may consider merging some revisions related to the vector optimization and commit them at once? They should be quite obvious.

I understand that reordering/rebasing several commits is painful... (I am also try avoiding git rebase --onto readPubNamesAndTypes HEAD\^)

MaskRay accepted this revision.Nov 12 2018, 12:21 AM
This revision is now accepted and ready to land.Nov 12 2018, 12:21 AM
lebedev.ri added inline comments.Nov 12 2018, 12:32 AM
tools/llvm-exegesis/lib/Clustering.cpp
140 ↗(On Diff #173619)

I've lost in the patch series :(

It is quite easy to orient.
Ctrl+F for "Revision Contents", then click on the "Stack (n open)" tab.
They are all listed there, in their correct order, from bottom to top.

lebedev.ri added inline comments.Nov 12 2018, 1:30 AM
tools/llvm-exegesis/lib/Clustering.cpp
140 ↗(On Diff #173619)

(replied too quickly)

I understand that reordering/rebasing several commits is painful.

The rebasing itself is absolutely not painful for me. It's trivial.
The only problem is that it will force me to re-benchmark every single differential,
and will result in less of an atomic incremental changes
(while those changes do make sense on their own.)

courbet accepted this revision.Nov 19 2018, 2:48 AM

@MaskRay @courbet thank you for the reviews!

This revision was automatically updated to reflect the committed changes.