This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Use a sigmoid style function for #usages boost in symbol quality.
ClosedPublic

Authored by ioeric on Jul 25 2018, 1:57 AM.

Diff Detail

Event Timeline

ioeric created this revision.Jul 25 2018, 1:57 AM
ioeric edited the summary of this revision. (Show Details)Jul 25 2018, 1:58 AM
ioeric edited the summary of this revision. (Show Details)

Overall LG. I'm sure it's an improvement overall, just wanted to get some clarifying comments and references, if that's possible.

NIT: a typo in the commit message
s/logrithm/logarithm

clangd/Quality.cpp
200

Made add references or intuition on why this boosting function is good?
Also on why can't we use the original boost function and need to simplify it?

203

Any reason to not use std::pow(References, -0.06) instead?
(not a suggestion to actually change the code, just wondering if there are any reasons (apart from personal preferences) to prefer one over the other)

ioeric updated this revision to Diff 157207.Jul 25 2018, 2:48 AM
ioeric marked 2 inline comments as done.

Addressed review comments.

ioeric added inline comments.Jul 25 2018, 2:48 AM
clangd/Quality.cpp
200

Turned out "simplification" might be the wrong word. Improved the comment a bit.

203

Nope, no particular reason. Positive exponent looks a bit nicer in formula, but I think it's fine here. Switched to std::pow(References, -0.06).

ilya-biryukov accepted this revision.Jul 25 2018, 3:51 AM

LGTM

clangd/Quality.cpp
194

NIT: better, but nothing to compare to in the comment.
Maybe use "better than log" or "nicely" instead?

This revision is now accepted and ready to land.Jul 25 2018, 3:51 AM
ioeric updated this revision to Diff 157225.Jul 25 2018, 4:24 AM

s/better/nicely/

This revision was automatically updated to reflect the committed changes.