[cfe-dev] JSONCompilationDatabase additional keys

Sean Silva silvas at purdue.edu
Fri Sep 13 23:31:35 PDT 2013


On Fri, Sep 13, 2013 at 5:59 AM, Manuel Klimek <klimek at google.com> wrote:

> On Thu, Sep 12, 2013 at 3:07 AM, Sean Silva <silvas at purdue.edu> wrote:
>
>>
>>
>>
>> On Wed, Sep 11, 2013 at 8:14 AM, Manuel Klimek <klimek at google.com> wrote:
>>
>>> On Wed, Sep 11, 2013 at 12:41 PM, Nicholas Gill <mythagel at gmail.com>wrote:
>>>
>>>> Hello cfe-dev,
>>>>
>>>> At present unknown keys in the compile_commands.json file will cause
>>>> the JSONCompilationDatabase parser to reject the file.
>>>>
>>>> 1. Would a patch to relax this constraint be accepted?
>>>> 2. Would other consumers of the compile_commands.json be negatively
>>>> impacted by unknown keys?
>>>>
>>>
>>> Yes. This can be rather big, and being able to quickly parse it is
>>> important for interactive use cases.
>>>
>>>
>>
>> I don't think that this is a very good reason. Parsing the compilation
>> database in the JSON format is going to take O(project size) work, and
>> anything O(project size) is not going to be adequate for interactive use
>> cases anyway.
>>
>
> How do you come to that conclusion? I've run benchmark on chromium-sized
> projects, and the interactive use-case worked just fine.
>
>

On my machine it takes 30ms to parse the compile_commands.json for
clang/llvm (measured with perf(1)). Typically interactive response time
expectation is 100ms, so 30ms is about 1/3 of the total time available,
which IMO is unacceptable. Conversely, a project >3x larger would be
noninteractive.

-- Sean Silva


>> -- Sean Silva
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130914/07800fb7/attachment.html>


More information about the cfe-dev mailing list