<div dir="ltr"><div>Hello,</div><div><br></div><div>Would an improvement for the issue below. Constitute material for the KDE Eco initiative?</div><div>If
so, I am a senior C++ developer. I do not know Qt. I have more than 2
hours per week to dedicate to the issue below. I will need help.</div><div><br></div><div>The ideal situation would be to not do custom painting.<br></div><div><br></div><div>Technical details:</div><div><br></div><div>As per <a href="https://blogs.gnome.org/chergert/2020/03/15/how-to-use-sysprof-to-part-ii/" target="_blank">https://blogs.gnome.org/chergert/2020/03/15/how-to-use-sysprof-to-part-ii/</a> chapter "Reducing Memory Allocations". kcalc in <a href="https://invent.kde.org/utilities/kcalc/-/blob/master/kcalc_button.cpp#L133" target="_blank">https://invent.kde.org/utilities/kcalc/-/blob/master/kcalc_button.cpp#L133</a>
for each button, does custom painting. mallocs e.g. in QTextDocument
ctor and in QTextDocument::setHtml(). The button's custom painting
method uses HTML mainly for center aligning/justifying text.</div><div><br></div><div> ALLOCATED TOTAL FUNCTION<br>[ 81.1 MiB] [ 69.04%] KCalcButton::paintEvent(QPaintEvent*)<br>[ 23.7 MiB] [ 20.20%] QTextDocument::QTextDocument(QObject*)<br>[ 15.7 MiB] [ 13.35%] QTextDocument::setHtml(QString const&)<br>[ 12.0 MiB] [ 10.21%] QTextDocument::size() const<br>[ 10.3 MiB] [ 8.74%] In file /usr/lib/x86_64-linux-gnu/qt5/plugins/styles/breeze.so<br>[ 6.6 MiB] [ 5.59%] QTextDocumentLayout::draw(QPainter*, QAbstractTextDocumentLayout::PaintContext const&)<br></div><div><br></div><div>Thanks.</div></div>