[clang] [llvm] [clang][Modules][Serialization] Avoid serializing duplicate source location entries for shared input files (PR #209795)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 18 14:47:24 PDT 2026


qiongsiwu wrote:

> > Can you give it a shot next week or so and report your findings on your codebases?
> 
> @qiongsiwu has offered to test this PR against something that resembles our workflows against Apple SDKs. We've been keen on reducing the size overhead that pcms accumulate across a developer's iteration cycle.

Sorry about the delay. I've tried two small compilations on macOS with Apple's SDKs, and I see no significant gain or regression on pcm file sizes. 

| workload | pcms | mode | baseline | patched | delta |
|---|---:|---|---:|---:|---:|
| libc++, C++20 | 25 | default | 53,023,572 | 53,011,396 | **−12,176 B** (−0.023%) |
| libc++, C++20 | 25 | `-fmodules-embed-all-files` | 73,309,504 | 73,162,128 | **−147,376 B** (−0.201%) |
| Foundation + CoreFoundation, ObjC | 30 | default | 24,766,164 | 24,760,680 | **−5,484 B** (−0.022%) |
| Foundation + CoreFoundation, ObjC | 30 | `-fmodules-embed-all-files` | 32,741,264 | 32,631,740 | **−109,524 B** (−0.335%) |

Workloads:

```c++
// tu.cpp  -> 25 pcms
#include <vector>
#include <string>
#include <map>
#include <memory>
#include <algorithm>
#include <functional>
```

```objc
// fw.h  -> 30 pcms
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
```

https://github.com/llvm/llvm-project/pull/209795


More information about the cfe-commits mailing list