[PATCH] D133660: [Support] Add fast path for StringRef::find with needle of length 2.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 19 09:34:21 PDT 2022
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: llvm/lib/Support/StringRef.cpp:174
// Build the bad char heuristic table, with uint8_t to reduce cache thrashing.
uint8_t BadCharSkip[256];
std::memset(BadCharSkip, N, 256);
----------------
As a future optimization, we could also look at making StringRef::count cache BadCharSkip.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133660/new/
https://reviews.llvm.org/D133660
More information about the llvm-commits
mailing list