[llvm-dev] StringSwitch efficiency

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 28 09:58:06 PDT 2020


On Wed, Oct 28, 2020 at 9:56 AM Paul C. Anagnostopoulos via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> At what point should I consider changing from a StringSwitch construct to
> something more efficient? TableGen has a few of them. In particular, the
> switch for looking up a bang operator has about 40 cases, all short strings.
>
> One trivial improvement would be to split it into two StringSwitch's based
> on the first letter of the operator name.
>

If that improves performance, then it sounds like a bug/area for
improvement in StringSwitch itself, perhaps?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201028/e0d70cec/attachment.html>


More information about the llvm-dev mailing list