microsoft/Terminal

[Performance] Replace std::vector with more lightweight structure in `RenderData::GetPatternId`

Aberta

#10.564 aberto em 6 de jul. de 2021

 (8 comentários) (1 reação) (0 responsável)C++ (9.275 forks)batch import
Area-PerformanceArea-RenderingHelp WantedIssue-TaskProduct-Meta

Métricas do repositório

Stars
 (103.173 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

This is about the scrolling test in #10563. A simplified repro would be:

time bash -c 'yes | head -n1000000'

which takes 7-8s with windows terminal and 300ms with gnome terminal.

Test case provided by @lhecker.

These lines show up in the hot paths of the trace of OpenConsole:

https://github.com/microsoft/terminal/blob/main/src/renderer/base/renderer.cpp#L788

image

It appears that simply constructing empty std::vector (empty because this is in conhost/OpenConsole) is quite expensive.

CC @PankajBhojwani

Guia do colaborador