# Stance on -cross-module-optimization

**URL:** <https://forums.swift.org/t/stance-on-cross-module-optimization/73288>\
**Category:** Compiler\
**Created:** [July 19, 2024, 8:30am UTC](https://forums.swift.org/t/stance-on-cross-module-optimization/73288 "2024-07-19T08:30:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![MahdiBM](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mahdibm/32/45271_2.png) [@MahdiBM](https://forums.swift.org/u/MahdiBM)\
**Post date:** [July 19, 2024, 12:12pm UTC](https://forums.swift.org/t/stance-on-cross-module-optimization/73288/2 "2024-07-19T12:12:36Z")

</div>

@dimi mentioned this nice response from @Erik_Eckstein in another post to me:

> [@Brave new world: best practices for cross-module optimization](https://forums.swift.org/t/brave-new-world-best-practices-for-cross-module-optimization/66869/3):
>
> In general, CMO is a significant performance win. But (as with most optimizations) there can be corner cases where you see a degradation. The critical problem with CMO is code size. Therefore the CMO which is enabled by default is much more conservative than the "aggressive" CMO, which must be explicitly enabled with -cross-module-optimization. impact on compilation times We didn't see any significant impact on compilation times. Especially with the default CMO which has only a relatively s…

So ... It appears the flag does still have some usage, and while CMO (cross-module-optimization) is enabled by default, explicitly enabling it will make it more aggressive?

And if code size doesn't matter much, one _should_ enable that setting?

---

_[View the full topic](https://forums.swift.org/t/stance-on-cross-module-optimization/73288)._
