Performance analysis of compiler support for parallel evaluation of C++ Constant expressions

Andrew Gozillon, Seyed Hossein Haeri, James Riordan, Paul Keir*

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Metaprogramming, the practice of writing programs that manipulate other programs at compile-time, continues to impact software development; enabling new approaches to optimisation, static analysis, and reflection. Nevertheless, a challenge associated with metaprogramming techniques, including C++ constexpr functionality, is an increase in compilation times. This paper presents ClangOz, a novel Clang-based research compiler that addresses this issue by evaluating annotated constant expressions in parallel, thereby reducing compilation time.

By evaluating constant expressions in parallel, ClangOz significantly reduces compilation times for metaprogramming-intensive codebases, enhancing developer productivity and iterative software development processes. To control this, ClangOz includes novel compiler intrinsics allowing developers to take full advantage of constexpr language features.

New i9-13900K benchmark results here demonstrate the performance advantage of ClangOz over traditional compilers, including a decrease in compile times across more benchmarks; and 100% parallel efficiency in two cases. Also introduced here is the C’est library, which provides a subset of the C++ standard library, with extended constexpr support.

We highlight applications of the constexpr language feature, and emphasise the relevance of ClangOz, a compiler tailored for parallel evaluation of relevant constant expressions. Developers can now utilise modern metaprogramming, while minimising compile times parametrically.
Original languageEnglish
Title of host publicationSoftware, System, and Service Engineering
Subtitle of host publicationS3E 2023 Topical Area, 24th Conference on Practical Aspects of and Solutions for Software Engineering, KKIO 2023, and 8th Workshop on Advances in Programming Languages, WAPL 2023, Held as Part of FedCSIS 2023, Revised Selected Papers
EditorsAleksander Jarzębowicz, Ivan Luković, Adam Przybyłek, Mirosław Staroń, Muhammad Ovais Ahmad, Mirosław Ochodek
PublisherSpringer Cham
Pages129-152
Number of pages24
ISBN (Electronic)9783031510755
ISBN (Print)9783031510748
DOIs
Publication statusPublished - 3 Jan 2024

Publication series

NameLecture Notes in Business Information Processing
Volume499
ISSN (Print)1865-1348
ISSN (Electronic)1865-1356

Keywords

  • complier
  • parallelism
  • C++
  • partial evaluation

Fingerprint

Dive into the research topics of 'Performance analysis of compiler support for parallel evaluation of C++ Constant expressions'. Together they form a unique fingerprint.

Cite this