diff options
| author | Tatsuyuki Ishi <ishitatsuyuki@gmail.com> | 2022-10-27 10:14:09 +0200 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2022-10-27 10:22:25 +0200 |
| commit | 826f38534816ff2890639e3a75d9d7381ffde5ac (patch) | |
| tree | 1a1422962c5c8e7caf898f549f96d1d511fc3569 /lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py | |
| parent | 350d68644445f53551df1a4ddd69bd4f54f09fff (diff) | |
[Support] Use find() for faster StringRef::count (NFC)
While profiling InclusionRewriter, it was found that counting lines was
so slow that it took up 20% of the processing time. Surely, calling
memcmp() of size 1 on every substring in the window isn't a good idea.
Use StringRef::find() instead; in the case of N=1 it will forward to
memcmp which is much more optimal. For 2<=N<256 it will run the same
memcmp loop as we have now, which is still suboptimal but at least does
not regress anything.
Differential Revision: https://reviews.llvm.org/D133658
Diffstat (limited to 'lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py')
0 files changed, 0 insertions, 0 deletions
