Fraunhofer-AISEC / cpg

A library to extract Code Property Graphs from C/C++, Java, Go, Python, Ruby and every other language through LLVM-IR.
https://fraunhofer-aisec.github.io/cpg/
Apache License 2.0
282 stars 62 forks source link

Expose (performance) statistics at the end of the translation #1705

Open oxisto opened 1 month ago

oxisto commented 1 month ago

Currently it's hard to determine the real performance of a CPG translation especially relative to the size of the input. We do have absolute values that are stored in the StatisticsHolder and can be printed at the end of the run (which actually might be nice to enable with an option). But the better comparison would be the time it took in relation to the LoC of the input. We do have a rather bad LoC metric for C++ but nothing for the other languages. Since we usually parsing our file input ourselves (with the exception of C++), an agnostic solution would be to calculate the LoC based on the file input.

Some nice things to consider:

oxisto commented 1 month ago

ok it seems I already implemented some of these things already in the StatisticsCollectionPass and we totally forgot about this pass, so we should just enable it then...