[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Review Request: Allow to get and set max size of pixmap cache from
From: "Michael Pyne" <mpyne () kde ! org>
Date: 2010-09-25 20:49:56
Message-ID: 20100925204956.5520.33115 () vidsolbach ! de
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5377/#review7798
-----------------------------------------------------------
trunk/KDE/kdelibs/kdeui/util/kimagecache.h
<http://svn.reviewboard.kde.org/r/5377/#comment7985>
You should specific units used for memory (i.e. highest memory size in =
bytes)
trunk/KDE/kdelibs/kdeui/util/kimagecache.h
<http://svn.reviewboard.kde.org/r/5377/#comment7984>
This needs a @since 4.6 (and to be clear, this cannot get backported to=
4.5, although it's good that it runs there too ;)
trunk/KDE/kdelibs/kdeui/util/kimagecache.h
<http://svn.reviewboard.kde.org/r/5377/#comment7986>
@since 4.6 here too.
trunk/KDE/kdelibs/kdeui/util/kimagecache.cpp
<http://svn.reviewboard.kde.org/r/5377/#comment7989>
Please use /8 here instead of /10. It gives slightly more memory by def=
ault, and it is a power of 2.
=
You should add spaces around the / operator as well (i.e. defaultCacheS=
ize / 8)
=
Also, given that we're dividing you should use qMax() to ensure that th=
e pixmap cache's maxCost has a minimum (perhaps 16 KiB).
- Michael
On 2010-09-22 07:51:22, Manuel Mommertz wrote:
> =
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5377/
> -----------------------------------------------------------
> =
> (Updated 2010-09-22 07:51:22)
> =
> =
> Review request for kdelibs and Michael Pyne.
> =
> =
> Summary
> -------
> =
> Set a reasonable maximum size for the pixmap cache and allow to get and s=
et this size.
> =
> For now the pixmap cache gets a maximum size of 10% from the shared data =
cache on disk. Is this a good value or should it be something different?
> =
> =
> Diffs
> -----
> =
> trunk/KDE/kdelibs/kdeui/util/kimagecache.h 1178059 =
> trunk/KDE/kdelibs/kdeui/util/kimagecache.cpp 1178059 =
> =
> Diff: http://svn.reviewboard.kde.org/r/5377/diff
> =
> =
> Testing
> -------
> =
> I use 4.5 branche with this patch applied for daily work. No Problems so =
far.
> =
> =
> Thanks,
> =
> Manuel
> =
>
[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://svn.reviewboard.kde.org/r/5377/">http://svn.reviewboard.kde.org/r/5377/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="/r/5377/diff/2/?file=36730#file36730line157" style="color: black; font-weight: \
bold; text-decoration: underline;">trunk/KDE/kdelibs/kdeui/util/kimagecache.h</a> \
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">class \
KDEUI_EXPORT KImageCache : public KSharedDataCache</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">157</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cm"> * @return The highest memory size to be used by cached \
pixmaps.</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">You should \
specific units used for memory (i.e. highest memory size in bytes)</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="/r/5377/diff/2/?file=36730#file36730line158" style="color: black; font-weight: \
bold; text-decoration: underline;">trunk/KDE/kdelibs/kdeui/util/kimagecache.h</a> \
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">class \
KDEUI_EXPORT KImageCache : public KSharedDataCache</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">158</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cm"> */</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This needs \
a @since 4.6 (and to be clear, this cannot get backported to 4.5, although it's \
good that it runs there too ;)</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="/r/5377/diff/2/?file=36730#file36730line164" style="color: black; font-weight: \
bold; text-decoration: underline;">trunk/KDE/kdelibs/kdeui/util/kimagecache.h</a> \
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">class \
KDEUI_EXPORT KImageCache : public KSharedDataCache</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">164</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cm"> * @param size The size in bytes</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">@since 4.6 \
here too.</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="/r/5377/diff/2/?file=36731#file36731line88" style="color: black; font-weight: \
bold; text-decoration: underline;">trunk/KDE/kdelibs/kdeui/util/kimagecache.cpp</a> \
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">class \
KImageCache::Private : public QObject</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">88</font></th> <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">d</span><span class="o">-></span><span class="n">pixmapCache</span><span \
class="p">.</span><span class="n">setMaxCost</span><span class="p">(</span><span \
class="n">defaultCacheSize</span><span class="p">);</span></pre></td> <th \
bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">88</font></th> <td bgcolor="#fdfebc" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">d</span><span class="o">-></span><span class="n">pixmapCache</span><span \
class="p">.</span><span class="n">setMaxCost</span><span class="p">(</span><span \
class="n">defaultCacheSize</span><span class="o"><span \
class="hl">/</span></span><span class="mi"><span class="hl">10</span></span><span \
class="p">);</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Please use \
/8 here instead of /10. It gives slightly more memory by default, and it is a power \
of 2.
You should add spaces around the / operator as well (i.e. defaultCacheSize / 8)
Also, given that we're dividing you should use qMax() to ensure that the pixmap \
cache's maxCost has a minimum (perhaps 16 KiB).</pre> </div>
<br />
<p>- Michael</p>
<br />
<p>On September 22nd, 2010, 7:51 a.m., Manuel Mommertz wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/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 kdelibs and Michael Pyne.</div>
<div>By Manuel Mommertz.</div>
<p style="color: grey;"><i>Updated 2010-09-22 07:51:22</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;">Set a reasonable maximum size for the pixmap cache and allow to get and \
set this size.
For now the pixmap cache gets a maximum size of 10% from the shared data cache on \
disk. Is this a good value or should it be something different?</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 use 4.5 branche with this patch applied for daily work. No Problems so \
far.</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>trunk/KDE/kdelibs/kdeui/util/kimagecache.h <span style="color: \
grey">(1178059)</span></li>
<li>trunk/KDE/kdelibs/kdeui/util/kimagecache.cpp <span style="color: \
grey">(1178059)</span></li>
</ul>
<p><a href="http://svn.reviewboard.kde.org/r/5377/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