mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-17 08:28:09 +08:00
Improve unicode codepoint Bisearch performance (#691)
Improve the performance of the functions for searching for codepoints in a table by passing the table array in as a reference instead of copying it. Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:

committed by
GitHub

parent
455998d759
commit
b2f66c7386
@@ -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; i<state.range(0); ++i) {
|
||||
content += content;
|
||||
}
|
||||
auto document = paragraph(content);
|
||||
Screen screen(200,200);
|
||||
Render(screen, document);
|
||||
}
|
||||
}
|
||||
BENCHMARK(BencharkText)->DenseRange(0, 10, 1);
|
||||
|
||||
} // namespace ftxui
|
||||
// NOLINTEND
|
||||
|
||||
|
Reference in New Issue
Block a user