Skip to content

Commit

Permalink
Vertex table: re-enable pseudorandom hash function
Browse files Browse the repository at this point in the history
  • Loading branch information
whatsthecraic committed Dec 8, 2021
1 parent e98c1a6 commit 29d90ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Enable assertions...: ${enable_assert}
Enable debug........: ${enable_debug}
Enable optimize.....: ${enable_optimize}
Enable NUMA support.: ${info_numa_support}
Enable huge pages...: ${info_huge_pages}
dnl Enable huge pages...: ${info_huge_pages}

Now type 'make -j'
--------------------------------------------------"
9 changes: 4 additions & 5 deletions src/memstore/vertex_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,11 @@ void VertexTable::reset_elt(uint64_t& /* in/out */ key, CompressedDirectPointer&
uint64_t VertexTable::hashf(uint64_t vertex_id, uint64_t capacity) { // crc
assert(vertex_id != TOMBSTONE && "This vertex should be stored in the special entry m_vertex1");

// 18/07/2020: we're going to always use vertex_id % capacity as hash function to improve locality and reduce computation effort
//#if defined(__SSE4_2__)
// return ( __builtin_ia32_crc32di(vertex_id, hashf_seed0) | (__builtin_ia32_crc32di(vertex_id, hashf_seed1) << 32)) % capacity;
//#else
#if defined(__SSE4_2__)
return ( __builtin_ia32_crc32di(vertex_id, hashf_seed0) | (__builtin_ia32_crc32di(vertex_id, hashf_seed1) << 32)) % capacity;
#else
return vertex_id % capacity;
//#endif
#endif
}

DirectPointer VertexTable::get(uint64_t vertex_id, uint64_t numa_node) const noexcept {
Expand Down

0 comments on commit 29d90ea

Please sign in to comment.