Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Dec 16, 2025

This change adds collection of three metrics to the scanner:

  • number of Swift module lookups
  • number of named Clang module lookups
  • recorded number of Clang modules which were imported into a Swift module by name

It re-uses the prior '-Rdependency-scan-cache', renaming it to '-Rdependency-scan' and adds emission of the above metrics as remarks when this flag is enabled. Followup changes will add further remarks about dependency scanner progress.

…s and emit them as remarks

This change adds collection of three metrics to the scanner:
- number of Swift module lookups
- number of named Clang module lookups
- recorded number of Clang modules which were imported into a Swift module by name

It re-uses the prior '-Rdependency-scan-cache', renaming it to '-Rdependency-scan' and adds emission of the above metrics as remarks when this flag is enabled. Followup changes will add further remarks about dependency scanner progress.
@artemcm
Copy link
Contributor Author

artemcm commented Dec 16, 2025

@swift-ci test


// CHECK-REMARK-SAVE: remark: Number of Swift module queries: '21'
// CHECK-REMARK-SAVE: remark: Number of named Clang module queries: '6'
// CHECK-REMARK-SAVE: remark: Number of recorded Clang module dependencies queried by-name from a Swift client: '6'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although it may be prudent to, one day, make the compiler assert/error if the number of queries exceeds the number of recorded by-name Clang dependencies, we are not quite there yet. I have a couple of follow-up changes in the pipeline which should remove further sources of duplicate queries.

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.

1 participant