Ericsson / CodeCompass

CodeCompass is a software comprehension tool for large scale software written in C/C++ and Java
https://codecompass.net
GNU General Public License v3.0
521 stars 102 forks source link

Increase incremental parsing performance of cppmetrics #670

Open mcserep opened 1 year ago

mcserep commented 1 year ago

Currently the CppAstNodeMetrics table is cleaned up during incremental parsing by iterating through all stored entities, querying the related CppAstNode, then the appropriate file. After that, CppAstNodeMetrics entities related to a deleted or modified file are erased.

I propose a likely more memory and time efficient approach: since the CppFileMetrics table is also maintained through the same logic (looking for entities related to a modified or deleted file), we could erase the related CppAstNodeMetrics entities in the same loop. (Probably a new ODB view is required to connect the CppAstNodeMetrics table to the files.)