Description
Context
Explicit module for swift helps with build speed by reducing the duplicated pcm file generation (via compilation). Implicit clang modules are used for Swift / Obj-C interop most commonly.
Build speed improvement comes from 1) not having to generate duplicate pcm files and 2) pcm files become explicit outputs of bazel compile actions making Bazel's action scheduling more efficient.
In Snapchat, we used to use clang modules for all objective-c library targets by default for Swift inter-op. But we realized the overhead from implicit clang modules, and changed to creating clang modules only when objective-c library is depended on by swift target. As a result, we were able to see ~50% improvement in clean full application build time (~40 --> ~20min).