[SERVER-33581] Add scons switch to build with /Zi instead of /Z7 on msvc Created: 01/Mar/18  Updated: 29/Oct/23  Resolved: 02/Mar/18

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

Type: Task Priority: Major - P3
Reporter: Henrik Edin Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-33661 Make /Zi default over /Z7 on msvc Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Using ninja, /DEBUG:FASTLINK and pch branch from Mark:

/Z7 full link

Pass 1: Interval #1, time = 7.406s
  Wait PDB close: Total time = 1.375s
Pass 2: Interval #2, time = 27.891s
Final: Total time = 35.297s
Final: Total time = 43.907s
[2676/2676] INSTALL mongod.exe

/Z7 incremental (change to db.cpp)

Pass 1: Interval #1, time = 7.141s
  Wait PDB close: Total time = 1.203s
Pass 2: Interval #2, time = 25.125s
Final: Total time = 32.266s
Final: Total time = 32.937s
[5/5] INSTALL mongod.exe

/Zi full link

Pass 1: Interval #1, time = 7.313s
  Wait PDB close: Total time = 2.672s
Pass 2: Interval #2, time = 14.078s
Final: Total time = 21.391s
Final: Total time = 30.032s
[2676/2676] INSTALL mongod.exe

/Zi incremental (change to db.cpp)

Pass 1: Interval #1, time = 7.187s
  Wait PDB close: Total time = 2.656s
Pass 2: Interval #2, time = 13.750s
Final: Total time = 20.937s
Final: Total time = 21.719s
[5/5] INSTALL mongod.exe



 Comments   
Comment by Githook User [ 02/Mar/18 ]

Author:

{'email': 'henrik.edin@mongodb.com', 'name': 'Henrik Edin', 'username': 'henrikedin'}

Message: SERVER-33581 New msvc-debugging-format SCons option that allow for compiling with /Zi instead of /Z7 with msvc which improves link times.
Branch: master
https://github.com/mongodb/mongo/commit/1ef8e418f15120c90699cfc5c6046f50bba7926a

Comment by Henrik Edin [ 01/Mar/18 ]

The linker seem to use more memory and I had issues with oom on evergreen when multiple links jobs are executed in parallel. So needed to keep the old behavior there.

/Zi still has that problem if you try and write to the same pdb during intermediate compilation (of object files etc). To solve that I'm using one pdb per object file as you can see in the review.

Comment by Eric Milkie [ 01/Mar/18 ]

Why would we add a switch to scons for this? Why not use /Zi all the time?

Comment by Eric Milkie [ 01/Mar/18 ]

Way back in the day, the reason why I switched the builds to use /Z7 (thus forcing the compiler to output separate debug files for each translation unit, in the old-style format) was because with shared PDB files, multiple simultaneous compilations would conflict on the PDB file and you would get file-is-locked errors from the compiler. It's great to see that this problem is now fixed.

Generated at Thu Feb 08 04:33:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.