MCPcopy Create free account
hub / github.com/antgroup/vsag / GetMemoryUsageDetail

Method GetMemoryUsageDetail

src/algorithm/hgraph.cpp:1495–1516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1493}
1494
1495std::string
1496HGraph::GetMemoryUsageDetail() const {
1497 JsonType memory_usage;
1498 if (this->ignore_reorder_) {
1499 this->use_reorder_ = false;
1500 }
1501 memory_usage["basic_flatten_codes"].SetInt(this->basic_flatten_codes_->CalcSerializeSize());
1502 memory_usage["bottom_graph"].SetInt(this->bottom_graph_->CalcSerializeSize());
1503 if (this->use_reorder_) {
1504 memory_usage["high_precise_codes"].SetInt(this->high_precise_codes_->CalcSerializeSize());
1505 }
1506 size_t route_graph_size = 0;
1507 for (const auto& route_graph : this->route_graphs_) {
1508 route_graph_size += route_graph->CalcSerializeSize();
1509 }
1510 memory_usage["route_graph"].SetInt(route_graph_size);
1511 if (this->extra_info_size_ > 0 && this->extra_infos_ != nullptr) {
1512 memory_usage["extra_infos"].SetInt(this->extra_infos_->CalcSerializeSize());
1513 }
1514 memory_usage["__total_size__"].SetInt(this->CalSerializeSize());
1515 return memory_usage.Dump();
1516}
1517
1518float
1519HGraph::CalcDistanceById(const float* query, int64_t id) const {

Callers 5

process_resultMethod · 0.45
process_resultMethod · 0.45
TestMemoryUsageDetailMethod · 0.45

Calls 4

SetIntMethod · 0.80
CalSerializeSizeMethod · 0.80
CalcSerializeSizeMethod · 0.45
DumpMethod · 0.45

Tested by 1

TestMemoryUsageDetailMethod · 0.36