summaryrefslogtreecommitdiff
path: root/absl/strings/internal/memutil_benchmark.cc
diff options
context:
space:
mode:
authorGravatar Connal de Souza <connaldesouza@google.com>2023-06-09 12:38:09 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-06-09 12:39:02 -0700
commit1feab4fff90f904518e66cf80971063486fbc984 (patch)
treed2a9dcdec9122ff9c62b21f3c9a9b5c1d6ff489e /absl/strings/internal/memutil_benchmark.cc
parente929ede4112cc21a5173578c88317c3f4c8e71cc (diff)
Optimize Cord Refcount decrement.
Introduce kHighRefcountMask which masks off flags and the LSb of the refcount value. In the cases where this mask is used, we don't need to check the LSb because we can assume the refcount is 1 when the rest of the masked RefcountAndFlags is empty, and the LSb doesn't matter if the masked value is not empty (either it's immortal or refcount > 1). This saves an instruction and a cycle (and + cmp -> tst) https://godbolt.org/z/Kz69eqfhq PiperOrigin-RevId: 539151659 Change-Id: I2ec7d72918f052c4b0938edd746af9d5b3052c7e
Diffstat (limited to 'absl/strings/internal/memutil_benchmark.cc')
0 files changed, 0 insertions, 0 deletions