DiscussionsIssue archiveOCCT:Configuration

Archived issue #0031677

Configuration - Allow Optimization Level O3 When Compiling With G++

CommunityOCCT:Configurationclosed3 public notes

Search issues

Description

Four years ago I have proposed to suppress optimization level O3 when compiling with g++. At that time O2 has lead to significantly smaller binaries and comparable execution speed in my tests. My proposal has been implemented as solution of issue #0027417.

I regret having done so. The g++ compilers have advanced and now in my new tests, optimization level O3 leads to significantly faster binaries than O2.

Here is my sizes table (g++ 10.1 with link-time optimization enabled):
+-------------------+----------+----------+----------+----------+
|                   |    O2    |    O3    |  O2+PGO  |  O3+PGO  |
+-------------------+----------+----------+----------+----------+
| DLLs Size [bytes] | 59328000 | 61991424 | 53314048 | 54062080 |
+-------------------+----------+----------+----------+----------+

PGO means "profile-guided optimization".

Note that the sizes increase with O3, but the difference is rather small.

Please also check these execution time results stemming from a unit test that mostly performs projections and evaluations on curves and surfaces:
+------------------------+--------+--------+--------+--------+
|                        |   O2   |   O3   | O2+PGO | O3+PGO |
+------------------------+--------+--------+--------+--------+
| Execution Time [msecs] | 129816 | 126795 | 117289 | 106026 |
+------------------------+--------+--------+--------+--------+

The speed-up with O3 is enormous.

In the light of the changed compiler behaviour, I would like to propose to undo optimization level O3 suppression.

Steps to reproduce

Not required

Public activity

3 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Benjamin Bihler
Date: Tue Jul 21 11:39:52 2020 +0200

    0031677: Configuration - Allow Optimization Level O3 When Compiling With G++
    
    Removed suppression of optimization level O3 with using Mingw64.
02Commenter 1
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17271.39000000011 / 17230.04000000007 [+0.24%]
Products
Total CPU difference: 800.6699999999917 / 791.7399999999936 [+1.13%]
Windows-64-VC14:
OCCT
Total CPU difference: 18742.140625 / 18745.390625 [-0.02%]
Products
Total CPU difference: 1329.234375 / 1321.390625 [+0.59%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
03Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records