[clang] Revise the modules document for clarity (PR #90237)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 26 12:44:37 PDT 2024


================
@@ -1753,17 +1740,18 @@ Possible Questions
 How modules speed up compilation
 --------------------------------
 
-A classic theory for the reason why modules speed up the compilation is:
-if there are ``n`` headers and ``m`` source files and each header is included by each source file,
-then the complexity of the compilation is ``O(n*m)``;
-But if there are ``n`` module interfaces and ``m`` source files, the complexity of the compilation is
-``O(n+m)``. So, using modules would be a big win when scaling.
-In a simpler word, we could get rid of many redundant compilations by using modules.
+A classic theory for the reason why modules speed up the compilation is: if
+there are ``n`` headers and ``m`` source files and each header is included by
+each source file, then the complexity of the compilation is ``O(n*m)``. But if
+there are ``n`` module interfaces and ``m`` source files, the complexity of the
+compilation is ``O(n+m)``. So, using modules would be a big win when scaling.
+In a simpler word, we could get rid of many redundant compilations by using
+modules.
 
-Roughly, this theory is correct. But the problem is that it is too rough.
-The behavior depends on the optimization level, as we will illustrate below.
+Roughly, this theory is correct. But the problem is that it is too rough. The
----------------
erichkeane wrote:

```suggestion
While this is accurate at a high level, this depends greatly on optimization level, as illustrated below.
```

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


More information about the cfe-commits mailing list