MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.78k stars 260 forks source link

Improving performance with PGO #942

Closed zamazan4ik closed 1 year ago

zamazan4ik commented 1 year ago

Hi!

Recently I did benchmarks for Profile-Guided Optimization (PGO) on Clangd (link). Since the results show improving performance in ~20%, I think the same thing could be applied to ccls as well.

More about PGO applications you can read here.

MaskRay commented 1 year ago

I am a PGO contributor:)

There is no action item on ccls side. The time is mostly spent in Clang. If Clang is optimized, ccls will get speedup. There is no really action item for llvm-project, either. You can read LLVM_BUILD_INSTRUMENTED and llvm/utils/collect_and_build_with_pgo.py

zamazan4ik commented 1 year ago

@MaskRay Am I correct, that you performed non-PGO vs PGO benchmarks on ccls somewhen earlier and proved that PGO does not have an (observable) effect on ccls? I mean applying PGO to the ccls codebase itself, not on Clang. If yes, could you share please the results?

findNextStep commented 1 year ago

@zamazan4ik PBO is used to accelerate code execution, and currently the most CPU consuming scenario for ccls is when processing C++files (aka index), which is mainly due to the effectiveness of libclang's code. I believe that PBO on CCLs will not improve the user experience

Perhaps it can improve the performance of finding references, but currently I have not encountered any performance issues with ccls when find references