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

List:       kde-core-devel
Subject:    Re: Review Request 113216: some little performance improvement for network kio
From:       "Milian Wolff" <mail () milianw ! de>
Date:       2013-10-13 17:04:00
Message-ID: 20131013170400.23912.65868 () vidsolbach ! de
[Download RAW message or body]

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


Imo it's wrong to return const& in the first place. You can bind const& also to \
temporaries, see e.g. \
http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/

Anyhow, this may marginally improve performance (if the compiler is really not smart \
enough to do that automatically), as you'll save the atomic incr/decr related to the \
internal refcounting of QString.

Considering that someone has done the work here now, imo it's OK to commit it. Still, \
this is a micro-optimization. If the maintainer of this code feels against it, I \
could also understand that.

- Milian Wolff


On Oct. 12, 2013, 12:06 p.m., Jaime Torres Amate wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113216/
> -----------------------------------------------------------
> 
> (Updated Oct. 12, 2013, 12:06 p.m.)
> 
> 
> Review request for KDE Runtime.
> 
> 
> Repository: kde-runtime
> 
> 
> Description
> -------
> 
> A new check by cppcheck (avoid to call the copy constructor).
> networkUri.serviceName() and networkUri.serviceType() and networkUri.hostAddress() \
> return const QString&. 
> 
> Diffs
> -----
> 
> kioslave/network/ioslave/networkslave.cpp a548f1a 
> 
> Diff: http://git.reviewboard.kde.org/r/113216/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Jaime Torres Amate
> 
> 


[Attachment #3 (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/113216/">http://git.reviewboard.kde.org/r/113216/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Imo it&#39;s wrong to \
return const&amp; in the first place. You can bind const&amp; also to temporaries, \
see e.g. http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/


Anyhow, this may marginally improve performance (if the compiler is really not smart \
enough to do that automatically), as you&#39;ll save the atomic incr/decr related to \
the internal refcounting of QString.

Considering that someone has done the work here now, imo it&#39;s OK to commit it. \
Still, this is a micro-optimization. If the maintainer of this code feels against it, \
I could also understand that.</pre>  <br />









<p>- Milian Wolff</p>


<br />
<p>On October 12th, 2013, 12:06 p.m. UTC, Jaime Torres Amate 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 KDE Runtime.</div>
<div>By Jaime Torres Amate.</div>


<p style="color: grey;"><i>Updated Oct. 12, 2013, 12:06 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kde-runtime
</div>


<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;">A new check by cppcheck (avoid to call the copy constructor). \
networkUri.serviceName() and networkUri.serviceType() and networkUri.hostAddress() \
return const QString&amp;.</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>kioslave/network/ioslave/networkslave.cpp <span style="color: \
grey">(a548f1a)</span></li>

</ul>

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







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








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



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

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