Abstract

C++ Modules, one of the new features of C++20, aim to fix the long-standing build scalability problems in the language. They provide an IOefficient, on-disk representation capable to reduce build times and peak memory usage. ROOT already employs the C++ modules technology in its dictionary system to improve performance and reduce the memory footprint. ROOT with C++ Modules was released as a technology preview in fall 2018, after intensive development during the previous few years. The current state is ready for production, however, there is still room for performance optimizations. In this talk, we show the road map for making this technology enabled by default in ROOT. We demonstrate a global module indexing optimization which allows reducing the memory footprint dramatically for many workflows. We will report user feedback on the migration to ROOT with C++ Modules.

Highlights

  • In C++ projects, the cost of header re-parsing is typically negligible in small to medium size codebases, but can be critical in larger codebases

  • At the time of writing of this paper we can only observe the behavior of the global module index in CMSSW indirectly by measuring the performance of the embedded in the ROOT distributed with CMSSW

  • The benchmark consists of running root.exe -l -b -q in a configuration to preload all modules; using a precompiled header files (PCH); and using an semantic GMI (SGMI)

Read more

Summary

Introduction

In C++ projects, the cost of header re-parsing is typically negligible in small to medium size codebases, but can be critical in larger codebases. ROOT-based applications are different, as the ROOT C++ interpreter, Cling [1], processes code at program execution time. Avoiding redundant content re-parsing can yield better runtime performance [2]. C++ Modules [3] have been supported in ROOT since version 6.16, in order to avoid unnecessary re-parsing and to improve the performance of applications using ROOT. We outlined the set of challenges to be overcome in order to "modularize" the production code base of the CMS experiment, CMSSW, and showed preliminary performance results. That work was based on a beta version of the C++ modules technology in ROOT version 6.16. In this paper we describe recent performance results and suggest a more efficient strategy of querying information from C++ modules which yields better memory usage and replaces the eager loading of all modules at program initialization time

Background
Indexing Module File Contents
Integration in the CMS Software – CMSSW
Performance Results
Conclusion

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.