[all-commits] [llvm/llvm-project] 6c6351: [clang][modules] Optimize construction and usage o...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Mon Oct 28 11:48:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c6351ee350589c8e6bcd69c3255374a714d87d0
      https://github.com/llvm/llvm-project/commit/6c6351ee350589c8e6bcd69c3255374a714d87d0
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M clang/include/clang/Basic/Module.h
    M clang/include/clang/Lex/ModuleMap.h
    M clang/lib/Basic/Module.cpp
    M clang/lib/Lex/ModuleMap.cpp
    M clang/lib/Serialization/ASTReader.cpp

  Log Message:
  -----------
  [clang][modules] Optimize construction and usage of the submodule index (#113391)

This patch avoids eagerly populating the submodule index on `Module`
construction. The `StringMap` allocation shows up in my profiles of
`clang-scan-deps`, while the index is not necessary most of the time. We
still construct it on-demand.

Moreover, this patch avoids performing qualified submodule lookup in
`ASTReader` whenever we're serializing a module graph whose top-level
module is unknown. This is pointless, since that's guaranteed to never
find any existing submodules anyway.

This speeds up `clang-scan-deps` by ~0.5% on my workload.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list