Add base::StrCat and StrAppend
This functions concatenate many strings at once, resulting in ~3x code size and >2x speed improvement compared to a sequence of "operator+". Some calls to JoinString that used an empty separator are replaced with the new StrCat function. I considered generating many overrides with different numbers of arguments. This generates different code. In some cases I observed the compiler generating more code vs. initializer_list, in others it seemed to generate slightly less. Even when it generates a little more code having a much simpler header file seemed preferable so I opted for the initializer list. Change-Id: Ie0fb52aabf60ad30ead55bdbeca1e586b33950fd Reviewed-on: https://chromium-review.googlesource.com/805115 Commit-Queue: Brett Wilson <brettw@chromium.org> Reviewed-by:Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#522374}
Showing
base/strings/strcat.cc
0 → 100644
base/strings/strcat.h
0 → 100644
Please register or sign in to comment