Skip to content

Commit

Permalink
Add reserve in p_bench.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed Oct 9, 2023
1 parent 764b0d7 commit 9c1ce0b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/phmap/p_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ void renumber(const std::vector<uint64_t>& vertex_ids, std::vector<std::array<ui
threadpool pool((supports_parallel_insertion) ? num_threads : 1);

stopwatch.start();
new_ids.reserve(vertex_ids.size() * 110 / 100);
pool.parallel_for(vertex_ids.size(), [&](uint64_t i) {
auto id = new_id++;
new_ids[vertex_ids[i]] = id;
Expand Down

0 comments on commit 9c1ce0b

Please sign in to comment.