Skip to content

Commit

Permalink
Use RawIndex = std::vector<std::array<.., 2>>.
Browse files Browse the repository at this point in the history
The memory layout of an `std::vector<std::array<...>>` is better than
`std::vector<std::vector<...>>`. This allows HighFive to avoid numerous
allocations and copies.
  • Loading branch information
Luc Grosheintz committed Oct 18, 2023
1 parent e49d49c commit de59161
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/edge_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <set>
#include <unordered_map>
#include <vector>
#include <array>


namespace bbp {
Expand All @@ -23,7 +24,7 @@ namespace edge_index {

namespace {

using RawIndex = std::vector<std::vector<uint64_t>>;
using RawIndex = std::vector<std::array<uint64_t, 2>>;

const char* const SOURCE_NODE_ID_DSET = "source_node_id";
const char* const TARGET_NODE_ID_DSET = "target_node_id";
Expand Down

0 comments on commit de59161

Please sign in to comment.