[cfe-dev] Announcing Crange
Anurag
gnurag at gmail.com
Fri May 9 13:44:25 PDT 2014
Hello Tobias,
On Fri, May 9, 2014 at 8:06 PM, Tobias Grosser <tobias at grosser.es> wrote:
> As Renato said, the run-time is critical. Some people may suggest to
> implement this in C/C++. However, starting with python is probably a good
> choice to try this out and also to understand the performance implications.
Implementing this in python did turn out to be a good learning
experience. I wouldn't have come this far, had I decided to stick to
C++.
> Some ideas:
>
> - You may want to look at the compilation database support in
> libclang to retrieve the set of files to process as well as
> the corresponding command lines
Compilation database support is on the top of my 'must have' list. To
keep things simple for now, I merely search for all C/C++ source and
header files and parse them, thereby losing command line includes and
flags.
> - I wonder how quick querying the database is. In fact,
> if those queries are quick (less than 50ms) even for big
> databases, this would extremely interesting as you could in
> an editor for example add missing includes as you type.
Identifier looks are quite fast. For the 22GB tags database I tested
earlier, I usually get ~60ms times. For references lookup I think I've
got bad SQL, since its taking a few seconds to respond.
> Ah, and it does actually only work if I don't use this worker stuff, but
> apply this patch:
>
> - pool.map(worker, worker_params)
> +
> + for p in worker_params:
> + worker(p)
Ah, It seems like there's a bug in my code. It doesn't spawn the
multiprocessing pool in some cases. I'll have a close look at this.
Thanks for your feedback Tobias
Anurag
More information about the cfe-dev
mailing list