diff --git a/src/ftxui/dom/benchmark_test.cpp b/src/ftxui/dom/benchmark_test.cpp index 76d20c1..bf8ca9f 100644 --- a/src/ftxui/dom/benchmark_test.cpp +++ b/src/ftxui/dom/benchmark_test.cpp @@ -30,6 +30,19 @@ static void BencharkBasic(benchmark::State& state) { } BENCHMARK(BencharkBasic)->DenseRange(0, 256, 16); +static void BencharkText(benchmark::State& state) { + while (state.KeepRunning()) { + std::string content = "HELLO world "; + for(int i=0; iDenseRange(0, 10, 1); + } // namespace ftxui // NOLINTEND diff --git a/src/ftxui/screen/string.cpp b/src/ftxui/screen/string.cpp index b477acb..c1baf16 100644 --- a/src/ftxui/screen/string.cpp +++ b/src/ftxui/screen/string.cpp @@ -1368,7 +1368,7 @@ const std::array g_word_break_intervals = {{ // Find a codepoint inside a sorted list of Interval. template -bool Bisearch(uint32_t ucs, const std::array table) { +bool Bisearch(uint32_t ucs, const std::array& table) { if (ucs < table.front().first || ucs > table.back().last) { // NOLINT return false; } @@ -1391,7 +1391,7 @@ bool Bisearch(uint32_t ucs, const std::array table) { // Find a value inside a sorted list of Interval + property. template -bool Bisearch(uint32_t ucs, const std::array table, C* out) { +bool Bisearch(uint32_t ucs, const std::array& table, C* out) { if (ucs < table.front().first || ucs > table.back().last) { // NOLINT return false; }