Skip to content

Commit c5c771d

Browse files
Abseil Teamcopybara-github
authored andcommitted
Adjust software prefetch to fetch 5 cachelines ahead, as benchmarking suggests this should perform better.
PiperOrigin-RevId: 797369149 Change-Id: Ia111b079db1a490e110e8d92ee2c6b287cfc8dc0
1 parent 2c83d70 commit c5c771d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

absl/hash/internal/hash.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ uint64_t Mix32Bytes(const uint8_t* ptr, uint64_t current_state) {
5959
uint64_t duplicated_state2 = current_state;
6060

6161
do {
62-
// Always prefetch the next cacheline.
63-
PrefetchToLocalCache(ptr + ABSL_CACHELINE_SIZE);
62+
PrefetchToLocalCache(ptr + 5 * ABSL_CACHELINE_SIZE);
6463

6564
uint64_t a = absl::base_internal::UnalignedLoad64(ptr);
6665
uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8);

0 commit comments

Comments
 (0)