[prev in list] [next in list] [prev in thread] [next in thread]
List: nepomuk
Subject: Re: [Nepomuk] Review Request: LiteralTerm to N3: Optimize by using a cache
From: "Sebastian Trueg" <sebastian () trueg ! de>
Date: 2012-09-17 16:30:33
Message-ID: 20120917163033.21897.45183 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On Sept. 17, 2012, 12:41 p.m., Sebastian Trueg wrote:
> > soprano/node.cpp, line 427
> > <http://git.reviewboard.kde.org/r/106471/diff/1/?file=85714#file85714line427>
> >
> > Does not look thread-safe. Is it?
>
> Vishesh Handa wrote:
> You're right. It's not thread safe [1]. I think putting a mutex in the \
> createEscapeHash code should fix it. What do you think?
> [1] http://blogs.msdn.com/b/oldnewthing/archive/2004/03/08/85901.aspx
I am not sure. That would be a static mutex which I think is bad. Better ask an \
expert like Thiago or David.
- Sebastian
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106471/#review19064
-----------------------------------------------------------
On Sept. 17, 2012, 9:50 a.m., Vishesh Handa wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106471/
> -----------------------------------------------------------
>
> (Updated Sept. 17, 2012, 9:50 a.m.)
>
>
> Review request for Nepomuk, Soprano and Sebastian Trueg.
>
>
> Description
> -------
>
> Optimize the N3 conversion by escaping all the necessary characters in
> one go, and by caching the QString version of the data type.
>
> They aren't that many data types, so this shouldn't take up too much
> space.
>
>
> Diffs
> -----
>
> soprano/node.cpp 8ebbe0e
>
> Diff: http://git.reviewboard.kde.org/r/106471/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Vishesh Handa
>
>
[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/106471/">http://git.reviewboard.kde.org/r/106471/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On September 17th, 2012, 12:41 p.m., <b>Sebastian \
Trueg</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">
<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="http://git.reviewboard.kde.org/r/106471/diff/1/?file=85714#file85714line427" \
style="color: black; font-weight: bold; text-decoration: \
underline;">soprano/node.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</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; \
">QString Soprano::Node::blankToN3( const QString& blank )</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">427</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="k">static</span> <span class="n">QHash</span><span class="o"><</span><span \
class="n">QChar</span><span class="p">,</span> <span class="n">QString</span><span \
class="o">></span> <span class="n">escapeHash</span> <span class="o">=</span> \
<span class="n">createEscapeHash</span><span class="p">();</span></pre></td> </tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Does not look \
thread-safe. Is it?</pre> </blockquote>
<p>On September 17th, 2012, 1:49 p.m., <b>Vishesh Handa</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;">You're right. \
It's not thread safe [1]. I think putting a mutex in the createEscapeHash code \
should fix it. What do you think?
[1] http://blogs.msdn.com/b/oldnewthing/archive/2004/03/08/85901.aspx</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I am not \
sure. That would be a static mutex which I think is bad. Better ask an expert like \
Thiago or David.</pre> <br />
<p>- Sebastian</p>
<br />
<p>On September 17th, 2012, 9:50 a.m., Vishesh Handa wrote:</p>
<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 Nepomuk, Soprano and Sebastian Trueg.</div>
<div>By Vishesh Handa.</div>
<p style="color: grey;"><i>Updated Sept. 17, 2012, 9:50 a.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;"> Optimize the N3 conversion by escaping all the necessary characters \
in one go, and by caching the QString version of the data type.
They aren't that many data types, so this shouldn't take up too much
space.</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>soprano/node.cpp <span style="color: grey">(8ebbe0e)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/106471/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
Nepomuk mailing list
Nepomuk@kde.org
https://mail.kde.org/mailman/listinfo/nepomuk
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic