[PR #8619] Use memory pool for PolyTextOut items in GDI Renderer #27254

Open
opened 2026-01-31 09:20:54 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/8619

State: closed
Merged: Yes


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.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/8619 **State:** closed **Merged:** Yes --- 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 #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.
claunia added the pull-request label 2026-01-31 09:20:54 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27254