[MDEV-19734] investigate the performance effects of -O2 vs -O3 , possibly -O1 for gcc Created: 2019-06-11 Updated: 2022-11-21 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Compiling |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Axel Schwenke |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
To avoid gcc bugs in the production software (such as Some people state that -O2 is faster than -O3, due to more compact code (less inlining or loop unrolling) and as result less cache misses . See https://stackoverflow.com/a/19985801/547065 for example. The task is about benchmarking, and giving recommendations. From the quality standpoint, we can assume that -O2 would have less bug, and it is better tested, since it is the optimization used most often for production software. |
| Comments |
| Comment by Otto Kekäläinen [ 2020-06-14 ] |
|
In Debian we have been carrying the patch https://salsa.debian.org/mariadb-team/mariadb-10.4/-/blob/master/debian/patches/0025-Change-the-default-optimization-from-O3-to-O2-in-mys.patch for some while. Should it be upstreamed or deleted? |
| Comment by Otto Kekäläinen [ 2020-10-06 ] |
|
We still have this patch in Debian with mariadb-10.5. Could you axel give some opinion on this? Or marko or danblack? See https://salsa.debian.org/mariadb-team/mariadb-10.5/-/tree/master/debian/patches |
| Comment by Daniel Black [ 2020-10-07 ] |
|
Why is Debian carrying them if it doesn't know the effect of them? |
| Comment by Otto Kekäläinen [ 2020-10-13 ] |
|
Because Ondrej Sury who participated in packaging some years back did |
| Comment by Daniel Black [ 2022-11-21 ] |
|
otto, the packaging should match what is most tested. At the moment, what's in the codebase is the most tested. The only buildbot -O2 forcing is with asan/msan builds. So I'd drop the patch on the basis that O3 is more tested. |