C++ performance got worse going from Ubuntu 20 to Ubuntu 21

Bug #1965451 reported by Peter Taraba
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-11 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

This is not a bug, more of a degradation of performance report.

Going from Ubuntu 20 to Ubuntu 21 (and same on Ubuntu 22 pre-release), I noticed that C++ performance got worse, while it stayed the same for pypy:

Ubuntu 21:
pypy 1.419s 1.387s 8.527% 2.469%
c++ 1.843s 1.719s 8.935% 2.465%

Ubuntu 20:
PyPy 1.410s 1.389s 8.463% 2.290%
C++ 1.588s 1.507s 8.781% 2.284%

details:
https://www.frisky.world/2022/03/what-happened-to-c-performance-going.html

software I use:
https://github.com/pepe78/python-performance

Tags: performance
Revision history for this message
Chris Guiver (guiverc) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Unfortunately, we cannot work on this bug because your description didn't include enough information. You may find it helpful to read "How to report bugs effectively" http://www.chiark.greenend.org.uk/~sgtatham/bugs.html. We'd be grateful if you would then provide a more complete description of the problem.

We have instructions on debugging some types of problems at http://wiki.ubuntu.com/DebuggingProcedures.

At a minimum, we need:

1. The specific steps or actions you took that caused you to encounter the problem.
2. The behavior you expected.
3. The behavior you actually encountered (in as much detail as possible).

Please also ensure that you include the release and flavour of Ubuntu that you are using.

Ubuntu's main products are 'year.month' in format (eg. 20.04), with only specialist snap only products using the 'year' format (eg. Ubuntu Core 20) with no products 20 & 21 (except Ubuntu Core 20, but it has no upgrade yet).

Please execute the following command only once, as it will automatically gather debugging information, in a terminal:

apport-collect 1965451

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Thank you!

Changed in gcc-11 (Ubuntu):
status: New → Incomplete
Revision history for this message
Peter Taraba (pt-pepe78) wrote :

That's a bummer! I think it's not too challenging to download Ubuntu 20 and Ubuntu 21 and test it out. :) (I really don't care that much that C++ gets slow... while it's a bummer, it's not a show stopper).

Revision history for this message
Peter Taraba (pt-pepe78) wrote (last edit ):

And if you really need repro steps, which I think are quite obvious

A.1. Install Ubuntu 20 (https://ubuntu.com/download/desktop/thank-you?version=20.04.4&architecture=amd64)
A.2. git clone https://github.com/pepe78/python-performance
A.3. cd python-performance
A.4. ./run.sh

B.1. Install Ubuntu 21 (https://ubuntu.com/download/desktop/thank-you/?version=21.10&architecture=amd64)
B.2. git clone https://github.com/pepe78/python-performance
B.3. cd python-performance
B.4. ./run.sh

compare results for C++ and PyPy. PyPy is around same, C++ got worse.

Have a nice day!

Revision history for this message
Matthias Klose (doko) wrote :

would you be able to track that down to some specific gcc-11 package version?

Revision history for this message
Peter Taraba (pt-pepe78) wrote (last edit ):

Hi Matthias,

it seems like the "bug" (performance slow down) is not dependent on gcc version (it happens with both g++9 and g++11):
https://www.frisky.world/2022/04/testing-ubuntu-2204-lts-jammy-jellyfish.html

but rather dependent on kernel version (5.13 linux kernel was faster than 5.15 linux kernel):
https://www.frisky.world/2022/04/its-probably-in-kernel.html

not really sure how many code commits there were between 5.13 and 5.15 linux kernel - that might be quite hard to find which commit caused this... if it was necessary or if it is possible to improve for performance.

Cheers

Revision history for this message
Peter Taraba (pt-pepe78) wrote :

It also looks like it already happened on 5.14, so I would be looking at commits between 5.13 and 5.14:

Linux-5.13.0-40-generic-x86_64-with-glibc2.29

c++ g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 1.524 1.507 8.431 2.278

Linux-5.14.10-300.fc35.x86_64-x86_64-with-glibc2.34

c++ g++ (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2) 1.800 1.707 8.785 2.633

Linux-5.15.0-27-generic-x86_64-with-glibc2.35

c++ g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0 1.728 1.713 8.406 2.266

more results:
https://github.com/pepe78/python-performance

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gcc-11 (Ubuntu) because there has been no activity for 60 days.]

Changed in gcc-11 (Ubuntu):
status: Incomplete → Expired
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.