MantisBT - Community
View Issue Details
0031677Community[OCCT] OCCT:Configurationpublic2020-07-21 12:252020-07-25 14:02
BenjaminBihler 
bugmaster 
normalintegration request 
verifiedfixed 
g++AllAll
[OCCT] 7.1.0 
[OCCT] 7.5.0* 
Not required
0031677: Configuration - Allow Optimization Level O3 When Compiling With G++
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.
Not required
No tags attached.
child of 0027417closed bugmaster Choose a Better Default Release Optimization Parameter for MinGW-w64 
Issue History
2020-07-21 12:25BenjaminBihlerNew Issue
2020-07-21 12:25BenjaminBihlerAssigned To => bugmaster
2020-07-21 12:39gitNote Added: 0093222
2020-07-21 12:39BenjaminBihlerStatusnew => resolved
2020-07-21 12:39BenjaminBihlerSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=23156#r23156
2020-07-21 12:43kgvRelationship addedchild of 0027417
2020-07-21 12:44kgvDescription Updatedbug_revision_view_page.php?rev_id=23158#r23158
2020-07-21 12:46kgvProduct Version7.4.0 => 7.1.0
2020-07-22 10:00kgvSeverityminor => integration request
2020-07-22 10:00kgvStatusresolved => reviewed
2020-07-25 13:22bugmasterNote Added: 0093319
2020-07-25 13:22bugmasterStatusreviewed => tested
2020-07-25 13:35bugmasterTest case number => Not required
2020-07-25 13:57bugmasterChangeset attached => occt master d27293d9
2020-07-25 13:57bugmasterStatustested => verified
2020-07-25 13:57bugmasterResolutionopen => fixed
2020-07-25 14:02gitNote Added: 0093337

Notes
(0093222)
git   
2020-07-21 12:39   
Branch CR31677 has been created by BenjaminBihler.

SHA-1: fb963c49a6190deb668168f9d6bfbe524aabbb28


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.
(0093319)
bugmaster   
2020-07-25 13:22   
Combination -
OCCT branch : IR-2020-07-24
master SHA - 4c7a3faef5f292475c23ee615ad49d57fc039b58
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-07-24 SHA - be95aa91db3bd344c872901349e58022d3c687fc
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
(0093337)
git   
2020-07-25 14:02   
Branch CR31677 has been deleted by inv.

SHA-1: fb963c49a6190deb668168f9d6bfbe524aabbb28