[PATCH] D106432: [clangd] Cleanup FuzzyFindRequest serialization and dex benchmark
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 21 05:22:46 PDT 2021
kbobyrev created this revision.
kbobyrev added a reviewer: sammccall.
Herald added subscribers: usaxena95, kadircet, arphaman.
kbobyrev requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.
- Due to the LLVM's JSON library changes (?), FuzzyFindRequest serialization is no longer valid since arrays are serialized as llvm::json::Array already. Hence, current implementation creates a nested array.
- YAML format is no longer the default, mention this for the benchmark.
- FIXME is no longer relevant. I ran benchmarks that showed no improvement with priority_queue years ago.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106432
Files:
clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp
clang-tools-extra/clangd/index/Index.cpp
clang-tools-extra/clangd/index/dex/Iterator.cpp
Index: clang-tools-extra/clangd/index/dex/Iterator.cpp
===================================================================
--- clang-tools-extra/clangd/index/dex/Iterator.cpp
+++ clang-tools-extra/clangd/index/dex/Iterator.cpp
@@ -207,7 +207,6 @@
return OS;
}
- // FIXME(kbobyrev): Would storing Children in min-heap be faster?
std::vector<std::unique_ptr<Iterator>> Children;
friend Corpus; // For optimizations.
};
Index: clang-tools-extra/clangd/index/Index.cpp
===================================================================
--- clang-tools-extra/clangd/index/Index.cpp
+++ clang-tools-extra/clangd/index/Index.cpp
@@ -49,12 +49,12 @@
llvm::json::Value toJSON(const FuzzyFindRequest &Request) {
return llvm::json::Object{
{"Query", Request.Query},
- {"Scopes", llvm::json::Array{Request.Scopes}},
+ {"Scopes", Request.Scopes},
{"AnyScope", Request.AnyScope},
{"Limit", Request.Limit},
{"RestrictForCodeCompletion", Request.RestrictForCodeCompletion},
- {"ProximityPaths", llvm::json::Array{Request.ProximityPaths}},
- {"PreferredTypes", llvm::json::Array{Request.PreferredTypes}},
+ {"ProximityPaths", Request.ProximityPaths},
+ {"PreferredTypes", Request.PreferredTypes},
};
}
Index: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp
===================================================================
--- clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp
+++ clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp
@@ -106,7 +106,7 @@
int main(int argc, char *argv[]) {
if (argc < 3) {
llvm::errs() << "Usage: " << argv[0]
- << " global-symbol-index.yaml requests.json "
+ << " global-symbol-index.dex requests.json "
"BENCHMARK_OPTIONS...\n";
return -1;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106432.360406.patch
Type: text/x-patch
Size: 1832 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210721/08ee883d/attachment.bin>
More information about the cfe-commits
mailing list