[PATCH] D136624: [clang][modules] Account for non-affecting inputs in `ASTWriter`

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 06:33:41 PDT 2022


jansvoboda11 added a comment.

I tried optimizing this patch a bit. Instead of creating compact data structure and using binary search to find the preceding non-affecting file, I now store the adjustment information for each `FileID` in a vector. During deserialization, `FileID` is simply used as an index into `SLocEntryInfos`. That didn't yield any measurable improvement in performance, though. I think the regression must be coming from the `SourceLocation`/`Offset` to `FileID` translation.

I don't see any obvious way to work around that. `SourceManager::getFileIDLocal()` already implements some optimizations that makes accessing nearby offsets fast. A separate `SourceManager` would avoid this bottleneck, but I'm not sure how much work that would entail (seems substantial).

@Bigcheese LMK if you're fine with the performance implications here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136624/new/

https://reviews.llvm.org/D136624



More information about the cfe-commits mailing list