[SERVER-76946] Investigate possible compilation time improvement by compiling gcc and clang from source Created: 09/May/23  Updated: 27/Oct/23  Resolved: 27/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Ivan Fefer Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Development Platform
Participants:

 Description   

When compiling the compilers we can do two things that should improve compilation time:
1. We can set arch parameter to match architecture we are using.

2. We can use profile-guided optimization to optimize compilers to specifically build mongodb. This is done by first compiling the compilers with -fprofile-generate, compiling mongodb to collect the profile and later re-compiling the compilers with optimizations, based on the collected profile with -fprofile-use.



 Comments   
Comment by Ivan Fefer [ 10/May/23 ]

https://llvm.org/docs/HowToBuildWithPGO.html

Comment by Daniel Moody [ 09/May/23 ]
  1. We already do this
  2. We use gcc's built in profile guided optimization which will optimize for the target system. We had plans to use mongo source as part of the PGO, but it has not been done yet. I don't think a ticket was made for that.
Generated at Thu Feb 08 06:34:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.