Skip to content

Commit

Permalink
feat(interactive): Increase the reserved slots for small graphs (#4299)
Browse files Browse the repository at this point in the history
We currently allocate an additional 1/4 of the required space when
opening a graph, resulting in a smaller reserved space for smaller
graphs. To address this, we are increasing the minimum capacity for
vertex storage to 4096.

Fix #4105
  • Loading branch information
zhanglei1949 authored Oct 24, 2024
1 parent 6aa557c commit 919efab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flex/storages/rt_mutable_graph/mutable_property_fragment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,11 @@ void MutablePropertyFragment::Open(const std::string& work_dir,
schema_.get_vertex_storage_strategies(v_label_name), true);
}

// We will reserve the at least 4096 slots for each vertex label
size_t vertex_capacity =
schema_.get_max_vnum(v_label_name); // lf_indexers_[i].capacity();
if (build_empty_graph) {
std::max(lf_indexers_[i].capacity(), (size_t) 4096);
if (vertex_capacity >= lf_indexers_[i].size()) {
lf_indexers_[i].reserve(vertex_capacity);
} else {
vertex_capacity = lf_indexers_[i].capacity();
}
vertex_data_[i].resize(vertex_capacity);
vertex_capacities[i] = vertex_capacity;
Expand Down

0 comments on commit 919efab

Please sign in to comment.