提交 651b05a0 编写于 作者: X xiaojun.lin

review change

上级 6546bf5a
......@@ -18,6 +18,7 @@
#include <iostream> // TODO(linxj): using Log instead
#include "knowhere/common/Timer.h"
#include "knowhere/common/Log.h"
namespace knowhere {
......@@ -51,30 +52,18 @@ TimeRecorder::PrintTimeRecord(const std::string& msg, double span) {
std::cout << str_log << std::endl;
break;
}
// case 1: {
// SERVER_LOG_DEBUG << str_log;
// break;
//}
// case 2: {
// SERVER_LOG_INFO << str_log;
// break;
//}
// case 3: {
// SERVER_LOG_WARNING << str_log;
// break;
//}
// case 4: {
// SERVER_LOG_ERROR << str_log;
// break;
//}
// case 5: {
// SERVER_LOG_FATAL << str_log;
// break;
//}
// default: {
// SERVER_LOG_INFO << str_log;
// break;
//}
case 1: {
KNOWHERE_LOG_DEBUG << str_log;
break;
}
// case 2: {
// KNOWHERE_LOG_TRACE << str_log;
// break;
// }
// case 3: {
// KNOWHERE_LOG_WARNING << str_log;
// break;
// }
}
}
......
......@@ -719,7 +719,7 @@ NsgIndex::Search(const float* query, const unsigned& nq, const unsigned& dim, co
std::vector<std::vector<Neighbor>> resset(nq);
params.search_length = k;
TimeRecorder rc("search");
TimeRecorder rc("NsgIndex::search", 1);
// TODO(linxj): when to use openmp
if (nq <= 4) {
GetNeighbors(query, resset[0], nsg, &params);
......@@ -730,7 +730,7 @@ NsgIndex::Search(const float* query, const unsigned& nq, const unsigned& dim, co
GetNeighbors(single_query, resset[i], nsg, &params);
}
}
rc.RecordSection("cost");
rc.RecordSection("search");
for (unsigned int i = 0; i < nq; ++i) {
int64_t var = resset[i].size() - k;
if (var >= 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册