[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Review Request 108992: Simple optimizations in SignalPlotter
From:       "Raul Fernandes" <rgfernandes () gmail ! com>
Date:       2013-02-22 15:47:10
Message-ID: 20130222154710.29675.73590 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Feb. 18, 2013, 1:39 a.m., Aleix Pol Gonzalez wrote:
> > I don't see loosening the variables' scope as a codebase improvement. Mostly \
> > otherwise. 
> > Also I'd like to know how you measured this 5% of improvement, which either way \
> > I'm unsure if it's worth it considering that this patch makes everything global, \
> > now.
> 
> Raul Fernandes wrote:
> I think it is the worst response that I can have.
> Never in my entire life I saw anyone that complains about creating classes outside \
> loops looses the scope because it is one of the most basic forms of optimizing the \
> code. Creating classes inside loops is a great waste of resources. That why KDE4 is \
> still bloat and slow. Is is so true that KDE3 is still alive.
> I think some developers should learn how to write better and fast code and avoid \
> some commentaries like this or "This is only one more full update. Who cares??" (I \
> saw this insanity in some place in KDE's code). This patch is one of those that I \
> should not put in review because it is so basic, but I do because I don't want to \
> commit anything without approval. 
> Aaron J. Seigo wrote:
> Raul, thanks for the patch. We appreciate contributions such as these, particularly \
> ones that work on improving what exists .. and this bit of code definitely could \
> use it. 
> However, we do not interact with each other in the way you did in your comment \
> here. We try to show each other respect and understanding. Not only do we find more \
> enjoyment and team spirit this way, but it prevents people from treating us the \
> same way. There are issues with your patch which I cover in my review, but I don't \
> suggest you ought to learn how to write better code or otherwise insult you. What \
> would that achieve, besides getting on your nerves? Nothing. 
> You did not answer Aleix's question about how you measured the improvement, which \
> is a very valid question. The least one can do is respect an honest question with \
> an honest answer, yes? 
> Our code of conduct describes our commitments to each other in these things: \
> http://www.kde.org/code-of-conduct/ 
> I hope you can receive this comment in the constructive manner which I intend it, \
> and look forward to more of your patches in the future. :)

Sorry about that but it was a reaction to one thing that always happens in open \
software. It is sometimes hard to a new contributor send patches to projects because \
the maintainers tend to reject new views from people outside. Sometimes in a rough \
way. I have several patches optimizing the code in KDE and cannot send upstream \
because this way of thinking. There are lot of developers in KDE that doesn't care \
about speed, maybe because they use superfast computers. But I use a core i5 third \
generation in work place and the KDE is laggy to me. Even the 4.10. This is why the \
KDE3 is still alive and the razor-qt exists. The reason they use is the speed. \
Considering the speed of computers today, the KDE should executes smooothly in any \
hardware with all effects active. Answering how I discovered the 5% of improvement I \
have profiled the code. I didn't attach the output of profiler because it takes a lot \
of space and the patch seems too trivial to me. This is the point. If such trivial \
patch have this reception, imagine other that makes huge changes in algoritms \
choosing one more complicated for the sake of speed. In this case I have one. \
Grouping all drawPath calls to avoid the context switching in QPainter.


- Raul


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108992/#review27607
-----------------------------------------------------------


On Feb. 17, 2013, 12:57 p.m., Raul Fernandes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108992/
> -----------------------------------------------------------
> 
> (Updated Feb. 17, 2013, 12:57 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Description
> -------
> 
> - create variables and classes outside the loops
> - reserve space in QList if we know already how many items will be added (avoid \
>                 unnecessary reallocations)
> - use const_iterator when possible
> - remove a useless call (p->setPen(Qt::NoPen) - it will be set latter before be \
>                 used)
> - avoid multiplications (x3, x2, x1 and x0)
> 
> 
> Diffs
> -----
> 
> plasma/widgets/signalplotter.cpp 8e9e294 
> 
> Diff: http://git.reviewboard.kde.org/r/108992/diff/
> 
> 
> Testing
> -------
> 
> I have tested with KDE 4.10 with no problems.
> I have seen a improvement of about 5% in drawPlots() function, the most expensive \
> function in painting. 
> 
> Thanks,
> 
> Raul Fernandes
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/108992/">http://git.reviewboard.kde.org/r/108992/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On February 18th, 2013, 1:39 a.m. UTC, <b>Aleix \
Pol Gonzalez</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px \
solid #d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">I don&#39;t see loosening the variables&#39; scope as a codebase \
improvement. Mostly otherwise.

Also I&#39;d like to know how you measured this 5% of improvement, which either way \
I&#39;m unsure if it&#39;s worth it considering that this patch makes everything \
global, now.</pre>  </blockquote>




 <p>On February 19th, 2013, 1:47 p.m. UTC, <b>Raul Fernandes</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think it is the worst \
response that I can have. Never in my entire life I saw anyone that complains about \
creating classes outside loops looses the scope because it is one of the most basic \
forms of optimizing the code. Creating classes inside loops is a great waste of \
resources. That why KDE4 is still bloat and slow.
Is is so true that KDE3 is still alive.
I think some developers should learn how to write better and fast code and avoid some \
commentaries like this or &quot;This is only one more full update. Who cares??&quot; \
(I saw this insanity in some place in KDE&#39;s code). This patch is one of those \
that I should not put in review because it is so basic, but I do because I don&#39;t \
want to commit anything without approval.</pre>  </blockquote>





 <p>On February 22nd, 2013, 1:38 a.m. UTC, <b>Aaron J. Seigo</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Raul, thanks for the \
patch. We appreciate contributions such as these, particularly ones that work on \
improving what exists .. and this bit of code definitely could use it.

However, we do not interact with each other in the way you did in your comment here. \
We try to show each other respect and understanding. Not only do we find more \
enjoyment and team spirit this way, but it prevents people from treating us the same \
way. There are issues with your patch which I cover in my review, but I don&#39;t \
suggest you ought to learn how to write better code or otherwise insult you. What \
would that achieve, besides getting on your nerves? Nothing.

You did not answer Aleix&#39;s question about how you measured the improvement, which \
is a very valid question. The least one can do is respect an honest question with an \
honest answer, yes?

Our code of conduct describes our commitments to each other in these things: \
http://www.kde.org/code-of-conduct/

I hope you can receive this comment in the constructive manner which I intend it, and \
look forward to more of your patches in the future. :)</pre>  </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Sorry about that but it \
was a reaction to one thing that always happens in open software. It is sometimes \
hard to a new contributor send patches to projects because the maintainers tend to \
reject new views from people outside. Sometimes in a rough way. I have several \
patches optimizing the code in KDE and cannot send upstream because this way of \
thinking. There are lot of developers in KDE that doesn&#39;t care about speed, maybe \
because they use superfast computers. But I use a core i5 third generation in work \
place and the KDE is laggy to me. Even the 4.10. This is why the KDE3 is still alive \
and the razor-qt exists. The reason they use is the speed. Considering the speed of \
computers today, the KDE should executes smooothly in any hardware with all effects \
active. Answering how I discovered the 5% of improvement I have profiled the code.
I didn&#39;t attach the output of profiler because it takes a lot of space and the \
patch seems too trivial to me. This is the point. If such trivial patch have this \
reception, imagine other that makes huge changes in algoritms choosing one more \
complicated for the sake of speed. In this case I have one. Grouping all drawPath \
calls to avoid the context switching in QPainter.</pre> <br />










<p>- Raul</p>


<br />
<p>On February 17th, 2013, 12:57 p.m. UTC, Raul Fernandes wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Plasma.</div>
<div>By Raul Fernandes.</div>


<p style="color: grey;"><i>Updated Feb. 17, 2013, 12:57 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
                break-word;">- create variables and classes outside the loops
- reserve space in QList if we know already how many items will be added (avoid \
                unnecessary reallocations)
- use const_iterator when possible
- remove a useless call (p-&gt;setPen(Qt::NoPen) - it will be set latter before be \
                used)
- avoid multiplications (x3, x2, x1 and x0)</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">I have tested with KDE 4.10 with no problems. I have seen a improvement \
of about 5% in drawPlots() function, the most expensive function in painting.</pre>  \
</td>  </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>plasma/widgets/signalplotter.cpp <span style="color: grey">(8e9e294)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/108992/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic