Author Topic: Improve performance for C++ cross-reference searches for common names  (Read 1719 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Unfortunately in our code base there are some pretty generic names such as "state" (as a member variable) or initialize() (as a member function) that appear in many, unrelated classes.

When I perform a cross-reference search, it takes a long time. The references window first shows all the potential files that the reference may be in (and there are SOOOO many), and then it takes some time to go through each one and decide to keep/remove it.

Maybe here is one case where a clang based parser (as a non-default option) could have better performance in finding the cross refs (although clang indexing may take longer, but I could run that overnight each night if needed, and only use it for special occasions like this one, but I suspect the actual finding of the refs once the index is there may be faster).
« Last Edit: August 23, 2018, 01:30:27 PM by rowbearto »

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Improve performance for C++ cross-reference searches for common names
« Reply #1 on: August 26, 2018, 12:18:43 AM »
Could you fire up a clang tool to find the references and send the result back to slickedit?

I suspect you could use the tag API, iterate through all source files, step from tag to tag using "next word", check the tag type and if it's a function or variable, then build a hash map to associate the word with the definition.  Run it overnight and use it to bring up a quick answer while slick is re-generating.  Sometimes it's critical to make sure you find all references and if the tag identification has some indirection or template involvement, I'm not sure what guarantee there is of finding everything.  Another possibility is to use a text indexing tool (or plain slick search), then run a macro to exclude files that don't have a #include of a particular header file that has the definition/ declaration of the tag.