usaxena95 updated this revision to Diff 295338.
usaxena95 added a comment.

Minor fixes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88590/new/

https://reviews.llvm.org/D88590

Files:
  clang-tools-extra/clangd/benchmarks/CMakeLists.txt
  clang-tools-extra/clangd/benchmarks/DecisionForestBenchmark.cpp


Index: clang-tools-extra/clangd/benchmarks/DecisionForestBenchmark.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/clangd/benchmarks/DecisionForestBenchmark.cpp
@@ -0,0 +1,57 @@
+//===--- DecisionForestBenchmark.cpp - Benchmark for code completion ranking
+//latency -----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "CompletionModel.h"
+#include "benchmark/benchmark.h"
+
+const char *IndexFilename;
+const char *RequestsFilename;
+
+namespace clang {
+namespace clangd {
+namespace {
+void RunDecisionForestPrediciton() {
+  Example E;
+
+  // E.setIsDeprecated(Quality.Deprecated);
+  // E.setIsReservedName(Quality.ReservedName);
+  // E.setIsImplementationDetail(Quality.ImplementationDetail);
+  // E.setNumReferences(Quality.References);
+  // E.setSymbolCategory(Quality.Category);
+
+  // E.setIsNameInContext(Derived.NameMatchesContext);
+  // E.setIsForbidden(Relevance.Forbidden);
+  // E.setIsInBaseClass(Relevance.InBaseClass);
+  // E.setFileProximityDistance(Derived.FileProximityDistance);
+  // E.setSemaFileProximityScore(Relevance.SemaFileProximityScore);
+  // E.setSymbolScopeDistance(Derived.ScopeProximityDistance);
+  // E.setSemaSaysInScope(Relevance.SemaSaysInScope);
+  // E.setScope(Relevance.Scope);
+  // E.setContextKind(Relevance.Context);
+  // E.setIsInstanceMember(Relevance.IsInstanceMember);
+  // E.setHadContextType(Relevance.HadContextType);
+  // E.setHadSymbolType(Relevance.HadSymbolType);
+  // E.setTypeMatchesPreferred(Relevance.TypeMatchesPreferred);
+  // E.setFilterLength(Relevance.FilterLength);
+  return Evaluate(E);
+}
+static void DecisionForestPredict(benchmark::State &State) {
+  for (auto _ : State)
+    RunDecisionForestPrediciton();
+}
+BENCHMARK(DecisionForestPredict);
+
+} // namespace
+} // namespace clangd
+} // namespace clang
+
+int main(int argc, char *argv[]) {
+  ::benchmark::Initialize(&argc, argv);
+  ::benchmark::RunSpecifiedBenchmarks();
+}
Index: clang-tools-extra/clangd/benchmarks/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/benchmarks/CMakeLists.txt
+++ clang-tools-extra/clangd/benchmarks/CMakeLists.txt
@@ -7,3 +7,11 @@
   clangDaemon
   LLVMSupport
   )
+
+add_benchmark(DecisionForestBenchmark DecisionForestBenchmark.cpp)
+
+target_link_libraries(DecisionForestBenchmark
+  PRIVATE
+  clangDaemon
+  LLVMSupport
+  )
\ No newline at end of file


Index: clang-tools-extra/clangd/benchmarks/DecisionForestBenchmark.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/clangd/benchmarks/DecisionForestBenchmark.cpp
@@ -0,0 +1,57 @@
+//===--- DecisionForestBenchmark.cpp - Benchmark for code completion ranking
+//latency -----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "CompletionModel.h"
+#include "benchmark/benchmark.h"
+
+const char *IndexFilename;
+const char *RequestsFilename;
+
+namespace clang {
+namespace clangd {
+namespace {
+void RunDecisionForestPrediciton() {
+  Example E;
+
+  // E.setIsDeprecated(Quality.Deprecated);
+  // E.setIsReservedName(Quality.ReservedName);
+  // E.setIsImplementationDetail(Quality.ImplementationDetail);
+  // E.setNumReferences(Quality.References);
+  // E.setSymbolCategory(Quality.Category);
+
+  // E.setIsNameInContext(Derived.NameMatchesContext);
+  // E.setIsForbidden(Relevance.Forbidden);
+  // E.setIsInBaseClass(Relevance.InBaseClass);
+  // E.setFileProximityDistance(Derived.FileProximityDistance);
+  // E.setSemaFileProximityScore(Relevance.SemaFileProximityScore);
+  // E.setSymbolScopeDistance(Derived.ScopeProximityDistance);
+  // E.setSemaSaysInScope(Relevance.SemaSaysInScope);
+  // E.setScope(Relevance.Scope);
+  // E.setContextKind(Relevance.Context);
+  // E.setIsInstanceMember(Relevance.IsInstanceMember);
+  // E.setHadContextType(Relevance.HadContextType);
+  // E.setHadSymbolType(Relevance.HadSymbolType);
+  // E.setTypeMatchesPreferred(Relevance.TypeMatchesPreferred);
+  // E.setFilterLength(Relevance.FilterLength);
+  return Evaluate(E);
+}
+static void DecisionForestPredict(benchmark::State &State) {
+  for (auto _ : State)
+    RunDecisionForestPrediciton();
+}
+BENCHMARK(DecisionForestPredict);
+
+} // namespace
+} // namespace clangd
+} // namespace clang
+
+int main(int argc, char *argv[]) {
+  ::benchmark::Initialize(&argc, argv);
+  ::benchmark::RunSpecifiedBenchmarks();
+}
Index: clang-tools-extra/clangd/benchmarks/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/benchmarks/CMakeLists.txt
+++ clang-tools-extra/clangd/benchmarks/CMakeLists.txt
@@ -7,3 +7,11 @@
   clangDaemon
   LLVMSupport
   )
+
+add_benchmark(DecisionForestBenchmark DecisionForestBenchmark.cpp)
+
+target_link_libraries(DecisionForestBenchmark
+  PRIVATE
+  clangDaemon
+  LLVMSupport
+  )
\ No newline at end of file
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to