Commit d6741a0
committed
perf: cold render optimizations — HFONT cache, color caching, NFC bypass, Reconstruct guard fix
Phase 2 cold render optimizations for the Views engine:
PATH-R1-FIX: Fix Reconstruct guard bug — Construct() left m_fNeedsReconstruct
true (from Init), so the warm Reconstruct guard never fired. Warm render dropped
from 98.20ms to 0.01ms (99.99% reduction).
PATH-C1: Add 8-entry HFONT LRU cache in VwGraphics to avoid redundant
CreateFontIndirect/DeleteObjectFont GDI kernel calls when cycling between the
same fonts (common in multi-writing-system text). ~2% cold reduction.
PATH-C2: Track current foreground/background colors and background mode in
VwGraphics. Skip redundant SetTextColor/SetBkColor/SetBkMode GDI calls when
values haven't changed. <1% cold reduction.
PATH-N1: NFC normalization bypass — OffsetInNfc/OffsetToOrig were performing
COM Fetch + ICU NFC normalization on every call (12+ times per FindBreakPoint).
Added NFC flag from CallScriptItemize; for NFC text (common case), return
identity offsets instantly. 8.2% cold reduction. Best on multi-run scenarios:
mixed-styles -27%, lex-deep -25%, lex-extreme -24%.
Overall cold render: 60.36ms -> 54.32ms (-10.0% average).
All 15 benchmark scenarios pass with 0% pixel variance.1 parent b7f5216 commit d6741a0
File tree
7 files changed
+473
-97
lines changed- Src/views
- lib
- openspec/changes/render-speedup-benchmark/research
7 files changed
+473
-97
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4239 | 4239 | | |
4240 | 4240 | | |
4241 | 4241 | | |
4242 | | - | |
4243 | | - | |
4244 | | - | |
4245 | | - | |
| 4242 | + | |
| 4243 | + | |
| 4244 | + | |
| 4245 | + | |
4246 | 4246 | | |
4247 | 4247 | | |
4248 | 4248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| 414 | + | |
| 415 | + | |
414 | 416 | | |
415 | | - | |
| 417 | + | |
416 | 418 | | |
417 | 419 | | |
418 | 420 | | |
| |||
504 | 506 | | |
505 | 507 | | |
506 | 508 | | |
507 | | - | |
| 509 | + | |
508 | 510 | | |
509 | 511 | | |
510 | 512 | | |
| |||
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
531 | | - | |
| 533 | + | |
532 | 534 | | |
533 | 535 | | |
534 | 536 | | |
| |||
750 | 752 | | |
751 | 753 | | |
752 | 754 | | |
753 | | - | |
| 755 | + | |
754 | 756 | | |
755 | 757 | | |
756 | 758 | | |
| |||
855 | 857 | | |
856 | 858 | | |
857 | 859 | | |
858 | | - | |
| 860 | + | |
859 | 861 | | |
860 | 862 | | |
861 | 863 | | |
| |||
969 | 971 | | |
970 | 972 | | |
971 | 973 | | |
972 | | - | |
| 974 | + | |
973 | 975 | | |
974 | 976 | | |
975 | 977 | | |
976 | | - | |
| 978 | + | |
977 | 979 | | |
978 | 980 | | |
979 | 981 | | |
| |||
990 | 992 | | |
991 | 993 | | |
992 | 994 | | |
993 | | - | |
| 995 | + | |
994 | 996 | | |
995 | 997 | | |
996 | 998 | | |
997 | 999 | | |
998 | 1000 | | |
999 | 1001 | | |
1000 | 1002 | | |
1001 | | - | |
| 1003 | + | |
1002 | 1004 | | |
1003 | 1005 | | |
1004 | 1006 | | |
1005 | 1007 | | |
1006 | | - | |
| 1008 | + | |
1007 | 1009 | | |
1008 | 1010 | | |
1009 | 1011 | | |
| |||
1029 | 1031 | | |
1030 | 1032 | | |
1031 | 1033 | | |
1032 | | - | |
| 1034 | + | |
1033 | 1035 | | |
1034 | 1036 | | |
1035 | 1037 | | |
| |||
1053 | 1055 | | |
1054 | 1056 | | |
1055 | 1057 | | |
1056 | | - | |
| 1058 | + | |
1057 | 1059 | | |
1058 | 1060 | | |
1059 | 1061 | | |
| |||
1082 | 1084 | | |
1083 | 1085 | | |
1084 | 1086 | | |
1085 | | - | |
| 1087 | + | |
1086 | 1088 | | |
1087 | 1089 | | |
1088 | 1090 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
1080 | 1092 | | |
1081 | 1093 | | |
1082 | 1094 | | |
| |||
1115 | 1127 | | |
1116 | 1128 | | |
1117 | 1129 | | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
1118 | 1139 | | |
1119 | 1140 | | |
1120 | 1141 | | |
| |||
2454 | 2475 | | |
2455 | 2476 | | |
2456 | 2477 | | |
2457 | | - | |
| 2478 | + | |
2458 | 2479 | | |
2459 | 2480 | | |
2460 | 2481 | | |
| |||
2466 | 2487 | | |
2467 | 2488 | | |
2468 | 2489 | | |
| 2490 | + | |
2469 | 2491 | | |
2470 | 2492 | | |
2471 | 2493 | | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
2472 | 2499 | | |
2473 | 2500 | | |
2474 | 2501 | | |
| |||
2477 | 2504 | | |
2478 | 2505 | | |
2479 | 2506 | | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
2480 | 2512 | | |
| 2513 | + | |
| 2514 | + | |
2481 | 2515 | | |
2482 | 2516 | | |
2483 | 2517 | | |
| |||
2624 | 2658 | | |
2625 | 2659 | | |
2626 | 2660 | | |
| 2661 | + | |
| 2662 | + | |
2627 | 2663 | | |
2628 | | - | |
| 2664 | + | |
2629 | 2665 | | |
2630 | 2666 | | |
2631 | 2667 | | |
| |||
2683 | 2719 | | |
2684 | 2720 | | |
2685 | 2721 | | |
2686 | | - | |
| 2722 | + | |
2687 | 2723 | | |
2688 | 2724 | | |
2689 | 2725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
| 236 | + | |
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
| |||
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
301 | | - | |
| 303 | + | |
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
| |||
0 commit comments