microsoft/Terminal

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

開放

#10,564 建立於 2021年7月6日

 (8 則留言) (1 個反應) (0 位負責人)C++ (9,275 個分叉)batch import
Area-PerformanceArea-RenderingHelp WantedIssue-TaskProduct-Meta

倉庫指標

星標
 (103,173 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南