Commit f2f7776
committed
perf: debounce message sync in ResponseMessage during streaming
The JSON.stringify sync runs for every visible message on each token,
not just the one streaming. Debounce to 50ms while streaming, sync
immediately when done.1 parent e346ea1 commit f2f7776
1 file changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
129 | 143 | | |
130 | 144 | | |
131 | 145 | | |
| |||
589 | 603 | | |
590 | 604 | | |
591 | 605 | | |
| 606 | + | |
| 607 | + | |
592 | 608 | | |
593 | 609 | | |
594 | 610 | | |
| |||
0 commit comments