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
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
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. |