Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use memory pool for PolyTextOut items in GDI Renderer #8619

Merged
3 commits merged into from
Jan 5, 2021

Conversation

miniksa
Copy link
Member

@miniksa miniksa commented Dec 19, 2020

Converts the poly text out string and width buffers to use a memory pool since we free/alloc those every frame and are just going to reuse them over and over.

PR Checklist

Detailed Description of the Pull Request / Additional comments

  • Sets up a PMR memory pool for the GDI Engine. It tends to alloc and free a bunch of little buffers during painting frames. The pool will likely hold onto that memory frame over frame, but we'd just be using it again and again and again anyway. So this way we avoid all the system memory allocator locks and syscalls.

Validation Steps Performed

  • Ran big.txt about 10x in the window. Checked WPR/WPA profile output before/after.

@miniksa miniksa added Product-Conhost For issues in the Console codebase Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-Performance Performance-related issue Issue-Bug It either shouldn't be doing this or needs an investigation. labels Dec 19, 2020
@miniksa
Copy link
Member Author

miniksa commented Dec 19, 2020

Before:
image

After:
image

The allocation count is pretty much gone for _PaintBufferOutputHelper.

@zadjii-msft zadjii-msft removed their assignment Jan 4, 2021
@miniksa miniksa added the Needs-Second It's a PR that needs another sign-off label Jan 5, 2021
@miniksa miniksa added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 5, 2021
@ghost
Copy link

ghost commented Jan 5, 2021

Hello @miniksa!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit a8b4044 into main Jan 5, 2021
@ghost ghost deleted the dev/miniksa/zipzoom_pmr branch January 5, 2021 22:10
mpela81 pushed a commit to mpela81/terminal that referenced this pull request Jan 28, 2021
Converts the poly text out string and width buffers to use a memory pool since we free/alloc those every frame and are just going to reuse them over and over. 

## PR Checklist
* [x] Supports microsoft#3075
* [x] I work here.
* [x] Profiled memory before/after. Tested manually with `big.txt`.

## Detailed Description of the Pull Request / Additional comments
- Sets up a PMR memory pool for the GDI Engine. It tends to alloc and free a bunch of little buffers during painting frames. The pool will likely hold onto that memory frame over frame, but we'd just be using it again and again and again anyway. So this way we avoid all the system memory allocator locks and syscalls.

## Validation Steps Performed
- Ran `big.txt` about 10x in the window. Checked WPR/WPA profile output before/after.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Performance Performance-related issue Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Second It's a PR that needs another sign-off Product-Conhost For issues in the Console codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants