lol

module-system.chapter.md: Elaborate on extendModules performance

+11 -2
+11 -2
doc/module-system/module-system.chapter.md
··· 75 75 76 76 If you're familiar with prototype inheritance, you can think of the current, actual `evalModules` invocation as the prototype, and the return value of `extendModules` as the instance. 77 77 78 + This functionality is also available to modules as the `extendModules` module argument. 79 + 80 + ::: {.note} 81 + 82 + **Evaluation Performance** 83 + 84 + `extendModules` returns a configuration that shares very little with the original `evalModules` invocation, because the module arguments may be different. 85 + 86 + So if you have a configuration that has been (or will be) largely evaluated, almost none of the computation is shared with the configuration returned by `extendModules`. 87 + 78 88 The real work of module evaluation happens while computing the values in `config` and `options`, so multiple invocations of `extendModules` have a particularly small cost, as long as only the final `config` and `options` are evaluated. 79 89 80 90 If you do reference multiple `config` (or `options`) from before and after `extendModules`, evaluation performance is the same as with multiple `evalModules` invocations, because the new modules' ability to override existing configuration fundamentally requires constructing a new `config` and `options` fixpoint. 81 - 82 - This functionality is also available to modules as the `extendModules` module argument. 91 + ::: 83 92 84 93 #### `_module` {#module-system-lib-evalModules-return-value-_module} 85 94