microsoft/Terminal

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

Open

#10,564 创建于 2021年7月6日

在 GitHub 查看
 (8 评论) (1 反应) (0 负责人)C++ (3,212 fork)batch import
Area-PerformanceArea-RenderingHelp WantedIssue-TaskProduct-Meta

仓库指标

Star
 (35,764 star)
PR 合并指标
 (平均合并 27天 19小时) (30 天内合并 24 个 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

贡献者指南