<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello everyone,<br>
<br>
<div class="moz-cite-prefix">On 23.05.2017 07:02, Marc-André Laperle
via cfe-dev wrote:<br>
</div>
<blockquote
cite="mid:AM4PR07MB3442522E06CBE5A8E71E9217A8F90@AM4PR07MB3442.eurprd07.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color:
rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica,
sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji',
NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji',
EmojiSymbols;" dir="ltr">
<p>Those are good points. I think we'll have to see how fast
the indexing without caching and then go from there. </p>
</div>
</div>
</blockquote>
We did such measurements when evaluated clang as a technology to be
used in NetBeans C/C++, I don't remember the exact absolute numbers
now, but the conclusion was:<br>
to be on par with the existing NetBeans speed we have to use
different caching, otherwise it was like 10 times slower.<br>
<br>
<blockquote
cite="mid:AM4PR07MB3442522E06CBE5A8E71E9217A8F90@AM4PR07MB3442.eurprd07.prod.outlook.com"
type="cite">
<div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color:
rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica,
sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji',
NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji',
EmojiSymbols;" dir="ltr">
<p>I think the precompiled preamble sounds useful at least for
opened editors for quick parsing as there can be many
reparsings of the same file without anything changes in the
inclusions (while typing, etc). </p>
</div>
</div>
</blockquote>
+1. Preambles need to be used to provides reasonable responsiveness.
Otherwise i.e. included boost header can consume unexpected time.<br>
In fact sometimes it's worth to have preambles granularity
per-functions (i.e. for files opened in editor), because when
developers modify code then most of the time they modify bodies.<br>
<br>
<blockquote
cite="mid:AM4PR07MB3442522E06CBE5A8E71E9217A8F90@AM4PR07MB3442.eurprd07.prod.outlook.com"
type="cite">
<div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color:
rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica,
sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji',
NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji',
EmojiSymbols;" dir="ltr">
<p>I think reusing the information from the previous version
is a good compromise but we also have to make sure building
the index for the first time is not too long or at least
make sure that there is sufficient functionality available
for users to start working and communicate that some
functionality is not available.</p>
</div>
</div>
</blockquote>
+1. Btw, may be It is worth to set some expectations what is
available during and after initial index phase.<br>
I.e. during initial phase you'd probably like to have navigation for
file opened in editor and can work in functions bodies.<br>
<br>
As to initial indexing:<br>
Using PTH (not PCH) gave significant speedup.<br>
Skipping bodies gave significant speedup, but you miss the
references and later have to reindex bodies on demand.<br>
Using chainged PCH gave the next visible speedup.<br>
<br>
Of course we had to made some hacks for PCHs to be more often
"reusable" (comparing to strict compiler rule) and keep multiple
versions. In average 2: one for C and one for C++ parse context.<br>
<br>
Also there is a difference between system headers and projects
headers, so systems' can be cached more aggressively. <br>
<br>
Vladimir<br>
NetBeans C/C++ Project Lead<br>
<br>
<blockquote
cite="mid:AM4PR07MB3442522E06CBE5A8E71E9217A8F90@AM4PR07MB3442.eurprd07.prod.outlook.com"
type="cite">
<div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color:
rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica,
sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji',
NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji',
EmojiSymbols;" dir="ltr">
<p><br>
</p>
<p>Cheers,</p>
<p>Marc-André</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b> Ilya
Biryukov <a class="moz-txt-link-rfc2396E" href="mailto:ibiryukov@google.com"><ibiryukov@google.com></a><br>
<b>Sent:</b> Friday, May 19, 2017 8:27:48 AM<br>
<b>To:</b> Marc-André Laperle<br>
<b>Cc:</b> Doug Schaefer; via cfe-dev; <a class="moz-txt-link-abbreviated" href="mailto:zaks.anna@gmail.com">zaks.anna@gmail.com</a>;
Zoltan Porkoláb; Marton Csordas<br>
<b>Subject:</b> Re: [cfe-dev] Adding indexing support to
Clangd</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi everyone,
<div><br>
</div>
<div>The problem with PCHs(either chained or not) is that
they only work for the source file, </div>
<div>i.e. you can only use it when you start the new file
from scratch, right? For header caching we</div>
<div>really want to reuse whatever information we have
cached even if it's included in a different </div>
<div>context(i.e. the order of includes is different in the
other translation unit), which is not possible with PCHs.</div>
<div><br>
</div>
<div>My point is that it's not at all straightforward how(or
if?) the PCHs can improve performance of processing </div>
<div>the same header twice.</div>
<div><br>
</div>
<div>And as long as building an index is as fast as a
recompile and we can reuse information from the previous </div>
<div>version(slightly outdated) the index while the new
version is building, we can probably get a good enough </div>
<div>UX without any compromises on correctness(and
introducing additional complexity, since I don't think
there's</div>
<div>a way to do header caching without significant changes
to clang itself).</div>
<div><br>
</div>
<div>CLion indeed has a custom parser and serialization
format, it's not clang-based.</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, May 18, 2017 at 10:33 PM,
Marc-André Laperle via cfe-dev
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr">
<div
id="m_2388803691680430024x_divtagdefaultwrapper"
dir="ltr" style="font-size: 12pt; color: rgb(0, 0,
0); font-family: Calibri, Arial, Helvetica,
sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe
UI Emoji', NotoColorEmoji, 'Segoe UI Symbol',
'Android Emoji', EmojiSymbols;">
<p>Yeah, it sounds like a good approach to tackle
header caching a bit later. "P<span>recompiled
preamble" looks promising so we can keep this
in mind as we go.</span></p>
<p><span><br>
</span></p>
<p><span>Cheers,</span></p>
<p><span>Marc-André<br>
</span></p>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_2388803691680430024x_divRplyFwdMsg"
dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b>
Doug Schaefer <<a moz-do-not-send="true"
href="mailto:dschaefer@blackberry.com"
target="_blank">dschaefer@blackberry.com</a>><br>
<b>Sent:</b> Thursday, May 18, 2017 10:44:18 AM<br>
<b>To:</b> Marc-André Laperle; via cfe-dev<br>
<b>Cc:</b> <a moz-do-not-send="true"
href="mailto:zeratul976@hotmail.com"
target="_blank">zeratul976@hotmail.com</a>;
<a moz-do-not-send="true"
href="mailto:zaks.anna@gmail.com"
target="_blank">zaks.anna@gmail.com</a>;
Dániel Krupp; Zoltan Porkoláb; Marton Csordas<br>
<b>Subject:</b> Re: Adding indexing support to
Clangd</font>
<div> </div>
</div>
</div>
<span class=""><font size="2"><span
style="font-size:10pt">
<div class="m_2388803691680430024PlainText">On
2017-05-17, 6:38 PM, "Marc-André Laperle"<br>
<<a moz-do-not-send="true"
href="mailto:marc-andre.laperle@ericsson.com"
target="_blank">marc-andre.laperle@ericsson.<wbr>com</a>>
wrote:<br>
> - For header caching, I wonder if it is
possible to reuse the<br>
>precompiled header support in Clang. There
would be some logic that would<br>
>decide whether or not a precompiled header
could be used depending on the<br>
>preprocessing context (same macro
definitions, etc).<br>
<br>
I¹m not certain header cacheing is needed
right away. We did it in the CDT<br>
because our parsers were fairly slow and
indexing a project took a very<br>
long time. I have hope that clang would be
faster. At the very least, you<br>
would want cacheing to be optional so you need
to be able to work without<br>
it. But make sure you have the architecture to
graft it in later.<br>
<br>
In CDT we cheated a lot to gain performance
and the cost of accuracy. The<br>
results are still very good so its an
interesting balancing act.<br>
<br>
Doug Schaefer<br>
Eclipse CDT Project Lead<br>
<br>
</div>
</span></font></span></div>
<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev"
rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>Regards,</div>
<div>Ilya Biryukov</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>