Commit 4baefb7
committed
perf(tui): cache rendered thinking-preview markdown across live ticks
The markdown render + regex parse for the thinking preview can run many times
per second on Live refresh ticks when no new content has arrived. Introduce
a cache key (the preview string) so markdown parsing only runs when the
pending thinking text actually changes, not on every spinner animation.
Includes tests verifying cache behavior and output equivalence.1 parent 81522bc commit 4baefb7
2 files changed
Lines changed: 66 additions & 2 deletions
File tree
- src/pythinker_code/ui/shell/visualize
- tests/ui_and_conv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
654 | 658 | | |
655 | 659 | | |
656 | 660 | | |
| |||
905 | 909 | | |
906 | 910 | | |
907 | 911 | | |
| 912 | + | |
| 913 | + | |
908 | 914 | | |
909 | 915 | | |
910 | 916 | | |
| |||
1151 | 1157 | | |
1152 | 1158 | | |
1153 | 1159 | | |
1154 | | - | |
1155 | | - | |
| 1160 | + | |
| 1161 | + | |
1156 | 1162 | | |
1157 | 1163 | | |
1158 | 1164 | | |
| |||
1171 | 1177 | | |
1172 | 1178 | | |
1173 | 1179 | | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
1174 | 1195 | | |
1175 | 1196 | | |
1176 | 1197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
672 | 715 | | |
673 | 716 | | |
674 | 717 | | |
| |||
0 commit comments