mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-27 02:45:26 +08:00
Switching the word count (80/100/150/200/300) in Insights > Topics > Wordcloud re-ran a full-corpus jieba segmentation on the Electron main thread, since topN only affects the final slice while the segmentation cost is independent of it. This blocked the main process and froze the UI. - Frontend: fetch the full word list once (max tier) and slice locally on word-count change, recomputing percentages over the displayed subset. Word-count switching no longer hits the backend or triggers segmentation. - Backend: for Chinese meaningful/custom mode, produce word frequency and POS-tag stats in a single jieba.tag pass instead of two, halving CPU for genuine recomputes (filter/time/member changes). Behavior is preserved (verified by an equivalence regression test). Co-authored-by: Cursor <cursoragent@cursor.com>