Set complete vectors instead of creting them at runtime
ClosedPublic

Authored by tcanabrava on Jun 18 2018, 4:32 PM.

Details

Summary

I tested a bit of code with -02 to measure the speed gains of using a std::initializer_list over appending to a temporary and appending to temporary is around 50% slower, so I removed all the code that appened to temporaries for a initializer list in breeze.

Diff Detail

Repository
R31 Breeze
Branch
removeTemporaryReallocs
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 223
Build 223: arc lint + arc unit
tcanabrava created this revision.Jun 18 2018, 4:32 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 18 2018, 4:32 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
tcanabrava requested review of this revision.Jun 18 2018, 4:32 PM
tcanabrava edited the summary of this revision. (Show Details)Jun 18 2018, 4:34 PM
tcanabrava added a reviewer: Breeze.
zzag added a subscriber: zzag.Jun 18 2018, 4:38 PM
This comment was removed by zzag.
zzag added inline comments.Jun 18 2018, 4:52 PM
kdecoration/breezesizegrip.cpp
53–54

Can be const.

147–148

Can be const.

kstyle/breezeshadowhelper.cpp
457–461

Not the best thing. But shadows in Breeze have positive margins so that's okay.

tcanabrava added inline comments.Jun 18 2018, 4:55 PM
kstyle/breezeshadowhelper.cpp
457–461

they where added to the data vector before, and the data vector is quint32, so I don't see the difference.

zzag added inline comments.Jun 18 2018, 4:56 PM
kdecoration/breezesizegrip.cpp
147–148

Also, couldn't you do

painter.drawPolygon( QVector<>{}
);
tcanabrava updated this revision to Diff 36515.Jun 22 2018, 1:01 PM
tcanabrava edited the summary of this revision. (Show Details)
  • Don't realloc _pixmap vector
  • Don't use a Temporary to Copy data over
  • Fix compile
  • Don't use temporaries, compilers can optimize better this way
tcanabrava marked 3 inline comments as done.Jun 22 2018, 1:02 PM

Sadly Breeze lost its maintainer recently, so reviewing this is going to have to be a community effort. Adding more people.

tcanabrava abandoned this revision.Aug 28 2018, 2:56 PM

Seems there's nobody to review.

heh, if you reopen it, I'll approve it

tcanabrava reclaimed this revision.Aug 28 2018, 3:04 PM
davidedmundson accepted this revision.Aug 28 2018, 3:05 PM
This revision is now accepted and ready to land.Aug 28 2018, 3:05 PM
This revision was automatically updated to reflect the committed changes.