将数学软件包转换为 C++20 模块的经验 [PDF]
Experience converting a mathematical software package to C++20 modules [PDF]

原始链接: https://arxiv.org/abs/2506.21654

arXivLabs是一个框架,允许合作者直接在我们的网站上开发和分享新的arXiv功能。与arXivLabs合作的个人和组织都已接受并认同我们开放、社区、卓越和用户数据隐私的价值观。arXiv致力于这些价值观,并且只与遵守这些价值观的合作伙伴合作。有想法开发一个能为arXiv社区增值的项目吗?了解更多关于arXivLabs的信息。

This Hacker News thread discusses an article about converting a large mathematical software package (deal.II) to C++20 modules. The initial comment highlights the article's finding: a modest 10% compile time reduction with modules, but unclear benefits for downstream projects. Several commenters suggest potential improvements. One proposes manual code restructuring for better module organization, despite the "boring" nature. Another suggests LLMs could assist in this task, although code reliability is a concern. Other points raised include modules primarily addressing parsing time, potential negative impacts on codegen, and the importance of modularizing dependencies. A comparison with precompiled headers (PCHs) is requested, with some arguing modules are superior, especially with C++23 standard library modules. Others emphasize the value of PCHs, forward declarations, and avoiding template overuse for compile-time optimization. The conversation also touches upon the impact of architectural decisions like using interfaces with thin headers, acknowledging the trade-offs between compile-time and runtime performance.
相关文章

原文

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

联系我们 contact @ memedata.com