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

List:       kfm-devel
Subject:    Re: Review Request: Dolphin - optimize use of PlacesItemModel
From:       Dan_Vrátil <dvratil () redhat ! com>
Date:       2012-11-09 15:08:15
Message-ID: 20121109150815.30195.39410 () vidsolbach ! de
[Download RAW message or body]

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

(Updated Nov. 9, 2012, 3:08 p.m.)


Review request for Dolphin and Frank Reininghaus.


Changes
-------

 - fixed all issues
 - relicensed PlacesCache to LGPLv2.1+


Description
-------

This patch optimizes PlacesItemModel in two places. The optimizations are n=
eeded when using udisks2 Solid backend (which will be shipped in KDE 4.10, =
but it's already used in KDE 4.9 at least in Fedora). udisks2 is a bit slow=
er because it only can enumerate all devices (unlike udisks where you can a=
sk for specific device) - and that takes time, especially when there are sl=
ow devices (cheap USB sticks, slow optical drive).

1) Solid devices are stored in a static cache, which takes care that on sta=
rtup Solid is only queried once (this eliminates CPU spikes by udisks2d dae=
mon and limits DBus traffic). The Solid query is run asynchronously, which =
has a positive impact on Dolphin startup time.

2) Don't create new PlacesItemModel on every context menu popup. This effec=
tively eliminates ~4 seconds delay between right click and the context menu=
 appearing on screen. The persistent model is owned by DolphinMainView.


Diffs (updated)
-----

  dolphin/src/panels/places/placescache.h PRE-CREATION =

  dolphin/src/CMakeLists.txt 8f7f4db =

  dolphin/src/dolphincontextmenu.cpp bb26c7a =

  dolphin/src/panels/places/placescache.cpp PRE-CREATION =

  dolphin/src/panels/places/placesitemmodel.h 463e564 =

  dolphin/src/panels/places/placesitemmodel.cpp 1789f18 =


Diff: http://git.reviewboard.kde.org/r/107168/diff/


Testing
-------

Start up time and opening context menu is faster, no CPU spikes from udisks=
2d deamon


Thanks,

Dan Vr=C3=A1til


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


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

<div>Review request for Dolphin and Frank Reininghaus.</div>
<div>By Dan Vrátil.</div>


<p style="color: grey;"><i>Updated Nov. 9, 2012, 3:08 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;"> - fixed all issues
 - relicensed PlacesCache to LGPLv2.1+
</pre>
  </td>
 </tr>
</table>




<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;">This patch optimizes PlacesItemModel in two places. The optimizations \
are needed when using udisks2 Solid backend (which will be shipped in KDE 4.10, but \
it&#39;s already used in KDE 4.9 at least in Fedora). udisks2 is a bit slower because \
it only can enumerate all devices (unlike udisks where you can ask for specific \
device) - and that takes time, especially when there are slow devices (cheap USB \
sticks, slow optical drive).

1) Solid devices are stored in a static cache, which takes care that on startup Solid \
is only queried once (this eliminates CPU spikes by udisks2d daemon and limits DBus \
traffic). The Solid query is run asynchronously, which has a positive impact on \
Dolphin startup time.

2) Don&#39;t create new PlacesItemModel on every context menu popup. This effectively \
eliminates ~4 seconds delay between right click and the context menu appearing on \
screen. The persistent model is owned by DolphinMainView.</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;">Start up time and opening context menu is faster, no CPU spikes from \
udisks2d deamon</pre>  </td>
 </tr>
</table>




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

 <li>dolphin/src/panels/places/placescache.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>dolphin/src/CMakeLists.txt <span style="color: grey">(8f7f4db)</span></li>

 <li>dolphin/src/dolphincontextmenu.cpp <span style="color: \
grey">(bb26c7a)</span></li>

 <li>dolphin/src/panels/places/placescache.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>dolphin/src/panels/places/placesitemmodel.h <span style="color: \
grey">(463e564)</span></li>

 <li>dolphin/src/panels/places/placesitemmodel.cpp <span style="color: \
grey">(1789f18)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/107168/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