Instead of recreating the formatted HTML representation of a message
*and* layouting that in a QTextDocument repeatedly, introduce a
LRU cache and use it in the MessageDelegateHelperText. This patch
noticeably improves the performance of scrolling in chat rooms with
lots of code blocks or other complicated messages.
Details
Details
Diff Detail
Diff Detail
- Repository
- R865 Ruqola
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 24426 Build 24444: arc lint + arc unit
Comment Actions
only call setTextWidth when needed
Apparently (according to perf) QTextDocument does a relayout when we call
setTextWidth even when the width didn't change... So only call it when needed.
Comment Actions
Very nice!
src/widgets/room/delegate/messagedelegatehelpertext.cpp | ||
---|---|---|
330 | Nice solution to use std::unique_ptr. |