[libcxx-commits] [libcxx] [libc++] Run the test suite with optimizations by default (PR #118006)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 28 05:50:07 PST 2024


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/118006

In production, libc++ is used with optimizations enabled 99.9% of the time. Therefore, I think it makes sense to run our tests with optimizations enabled by default, to be closer to what people actually use in production. It's still possible to disable optimizations for debugging purposes or other reasons.

This also removes the pitfall of trying to run the benchmarks but forgetting to set the optimization level.

>From 3716a76ba5b82a7e41276a9c7bfce1c16ec7aa4e Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 28 Nov 2024 08:48:25 -0500
Subject: [PATCH] [libc++] Run the test suite with optimizations by default

In production, libc++ is used with optimizations enabled 99.9% of the
time. Therefore, I think it makes sense to run our tests with optimizations
enabled by default, to be closer to what people actually use in production.
It's still possible to disable optimizations for debugging purposes or
other reasons.

This also removes the pitfall of trying to run the benchmarks but
forgetting to set the optimization level.
---
 libcxx/utils/libcxx/test/params.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 2c5cb169c0a9a3..8ecd1a32799a31 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -193,7 +193,7 @@ def getSuitableClangTidy(cfg):
         choices=["none", "speed", "size"],
         type=str,
         help="The optimization level to use when compiling the test suite.",
-        default="none",
+        default="speed",
         actions=lambda opt: filter(None, [
             AddCompileFlag(lambda cfg: getSpeedOptimizationFlag(cfg)) if opt == "speed" else None,
             AddCompileFlag(lambda cfg: getSizeOptimizationFlag(cfg)) if opt == "size" else None,



More information about the libcxx-commits mailing list