Andersbakken/rtags — pull request #167 by terranpro (2014-04-17 08:40:01+00:00)
Title: Performance improvements for rtags-diagnostics-process-filter

Was trying to boost performance from the emacs side for the case where completion candidate count is large.

I tested using a medium sized project where the candidate count in the global space returned by rtags was ~19,700.

At first, I tried changing the logic to use only one string-match for all three tags, and then change length and cut and parse whatever it found.

My next step was to switch from using `rtags-pending-diagnostics` and `string-match` to a buffer and `search-forward-regexp`. I wasn't sure that the last one would have better performance, but it appears to.

Measurements done through `elp-instrument-function`:

Original
Function name Call Count Elapsed Time Avg Time
rtags-diagnostics-process-filter 473 15.685630686 0.0331620099

Regexp Only Change
Function name Call Count Elapsed Time Avg Time
rtags-diagnostics-process-filter 473 8.782461755 0.0185675724

Regexp + Buffer Based
Function name Call Count Elapsed Time Avg Time
rtags-diagnostics-process-filter 473 3.8434000999 0.0081255816

Please check and see if the results are similar for you and/or if there any problems or further opportunities for improvements.

Thanks!