4 Commits

Author SHA1 Message Date
ykiko
f19e75e2fb bench: add heavy AST load test forcing full PCH deserialization
Adds a "heavy" source file that references types from all 70 headers
(vector, map, optional, regex, thread, chrono, etc.) to stress-test
PCH chain deserialization. Even under full deserialization the chained
PCH overhead is only +6% vs monolithic.

Also adds an end-to-end benchmark simulating the real workflow:
1. Monolithic PCH build (what user waits for): 1233ms
2. Background chain split (async): 2672ms (user doesn't wait)
3. Incremental append of <chrono>: 28ms vs 1251ms rebuild (44x speedup)
4. Correctness verification: PASS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 15:03:08 +08:00
ykiko
ba191943b6 bench: add heavy AST load test forcing full PCH deserialization
Adds a second scenario that references symbols from all 70 headers,
forcing clang to fully deserialize the entire PCH chain. Results:

- Light source (3 types):  chained +2% overhead
- Heavy source (all 70 headers): chained +6% overhead

Even in the worst case, chained PCH adds only 28ms to compilation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 15:02:21 +08:00
ykiko
90f3d34768 bench: add AST load latency comparison for chained vs monolithic PCH
Measures the cost of compiling a source file against a chained PCH (70
links) vs a monolithic PCH. Result: chained PCH adds only ~4% overhead
to AST load, making it practical for production use.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 15:02:21 +08:00
ykiko
5b24dac6c3 bench: add chained PCH benchmark
Adds a benchmark comparing monolithic PCH vs chained PCH (one link per

Key findings on 70 C++ stdlib headers:
- Monolithic full build: ~1300ms
- Chained full build: ~2600ms (2x, expected serialization overhead)
- Incremental append-one-link: ~37ms vs ~1300ms monolithic rebuild (36x speedup)
- All 70 chain links compile and verify successfully

Also documents that PrecompiledPreambleBytes bound must be 0 for chained
PCH (each link is a separate file, previous PCH doesn't cover current file).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 15:02:21 +08:00
2 changed files with 1064 additions and 0 deletions

View File

@@ -200,6 +200,14 @@ if(CLICE_ENABLE_BENCHMARK)
"${PROJECT_SOURCE_DIR}/src"
)
target_link_libraries(scan_benchmark PRIVATE clice::core kota::deco)
add_executable(pch_chain_benchmark
"${PROJECT_SOURCE_DIR}/benchmarks/pch_chain/pch_chain_benchmark.cpp"
)
target_include_directories(pch_chain_benchmark PRIVATE
"${PROJECT_SOURCE_DIR}/src"
)
target_link_libraries(pch_chain_benchmark PRIVATE clice::core)
endif()
if(CLICE_RELEASE)

File diff suppressed because it is too large Load Diff