Skip to content

[Index] Add option to compress unit and record files #10977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 10, 2025

This option reduces the size of the index in a mixed clang + Swift project I have tested by about 70% while increasing the indexing overhead by about 10-15% overhead (from 1.07% to ~1.2%).

@ahoppen
Copy link
Member Author

ahoppen commented Jul 10, 2025

@swift-ci Please test llvm

Copy link

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Have you run any benchmarks on the reading side?

@@ -0,0 +1,8 @@
// RUN: rm -rf %t.idx
// RUN: %clang_cc1 %s -index-store-path %t.idx -index-store-compress-records

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you switched to compressing both at some point?

@ahoppen
Copy link
Member Author

ahoppen commented Jul 14, 2025

Nice. Have you run any benchmarks on the reading side?

Reading all unit and record files of a reasonably sized mixed Swift + C test project increased by ~25% (189ms vs. 152ms). I would argue that the 60-70% size savings (12MB vs. 40MB / 16.6MB on disk vs. 44.4MB on disk) are worth that performance regression in the millisecond range.

@ahoppen ahoppen force-pushed the compress-records branch from 17fcd27 to 4465df2 Compare July 14, 2025 10:24
@ahoppen
Copy link
Member Author

ahoppen commented Jul 14, 2025

@swift-ci Please test llvm

This option reduces the size of the index in a mixed clang + Swift project I have tested by about 70% while increasing the indexing overhead by about 10-15% overhead (from 1.07% to ~1.2%).
@ahoppen ahoppen force-pushed the compress-records branch from 4465df2 to 626ae63 Compare July 15, 2025 09:01
@ahoppen
Copy link
Member Author

ahoppen commented Jul 15, 2025

@swift-ci Please test llvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants