g++-14 performance regression - built with debug checks

Bug #2072478 reported by Ruben Perez
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gcc-14 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

System information (Docker container for ubuntu:24.04):

```
$> lsb_release -rd
No LSB modules are available.
Description: Ubuntu 24.04 LTS
Release: 24.04
```

Package information:

```
$> apt-cache policy g++-14
g++-14:
  Installed: 14-20240412-0ubuntu1
  Candidate: 14-20240412-0ubuntu1
  Version table:
 *** 14-20240412-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        100 /var/lib/dpkg/status
```

g++-14 in Ubuntu 24.04 builds extremely slow. At Boost, we've noticed increases of around x2 in CI build times.

This thread by some of my colleagues at Boost summarizes the problems we've found: https://www.reddit.com/r/cpp/comments/1cfzydb/gcc_14_twice_as_slow_as_gcc_13/

It looks like Ubuntu 24.04 g++-14 is indeed a debug build, and hence the slowdown. Running in an `ubuntu:24.04` Docker container the following:

```
apt update
apt install -y --no-install-recommends g++-14
g++-14 -v
```

Yields the following:

```
g++-14 -v
Using built-in specs.
COLLECT_GCC=g++-14
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/14/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 14-20240412-0ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr --with-gcc-major-version-only --program-suffix=-14 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-14-OQFzmN/gcc-14-14-20240412/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-14-OQFzmN/gcc-14-14-20240412/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=yes,extra,rtl --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240412 (experimental) [master r14-9935-g67e1433a94f] (Ubuntu 14-20240412-0ubuntu1)
```

The problem is `--enable-checking=...` - as per the GCC configure reference page (https://gcc.gnu.org/install/configure.html), it should be set to `--enable-checking=release`.

Reading gcc's configure page, I think this happened because gcc was built from the master branch (as the release branch wasn't out at the time Ubuntu 24.04 was published).

Now that gcc 14 is officially out, it would be great if we could get an updated package with gcc built in release mode.

Thanks,
Ruben.

Paul White (paulw2u)
affects: ubuntu → gcc-14 (Ubuntu)
tags: added: noble
tags: added: release-oo-incoming
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-14 (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

this is fixed in oracular, and will be fixed with the backport of the 14.2.0 release later. See LP: #2073390.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.