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

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 25 02:16:38 PDT 2018


ilya-biryukov added a comment.

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



================
Comment at: clangd/Quality.cpp:200
+    //   f = 12.0
+    //   boost = f * sigmoid(m * std::log(References)) - 0.5 * f + 0.59
+    // Sample data points: (10, 1.00), (100, 1.41), (1000, 1.82),
----------------
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?


================
Comment at: clangd/Quality.cpp:203
+    //                     (10K, 2.21), (100K, 2.58), (1M, 2.94)
+    float s = 1.0 / std::pow(References, 0.06);
+    Score *= 6.0 * (1 - s) / (1 + s) + 0.59;
----------------
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)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49780





More information about the cfe-commits mailing list