Build: add global precompiled header #111225
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111225
Loading…
Reference in New Issue
No description provided.
Delete Branch "aras_p/blender:global_pch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PCH includes commonly used STL bits:
<algorithm>
,<atomic>
,<memory>
,<string>
,<vector>
. Build time tests:<algorithm>
and<string>
were)678d3050c5
to4fb1ccfec0
While playing with this patch a while ago, there was some uneasiness about it I just can't shake
It was meant as a global pch (ie build once) but what cmake is doing is adding a PCH step to all C++ projects (ie bf_xxx_yyy) to precompile these headers, so rather than the common headers getting parsed 2600ish.. times, it's down to 100-150ish times, which is better, but not down to 1 which i was hoping for.
cmake has an option to reuse a PCH using
REUSE_FROM
but I couldn't get that to work.Now if it's gonna add a PCH step to every sub project anyhow, we can likely do better our selves, and manually craft precompiled headers finely tuned for the projects that need it most rather than feeling all of them a generic set of common offenders.
As far as I can tell, pretty much "everything" right now in Blender needs
<algorithm>
and<string>
. Which is unfortunate since C++ decided to put tons of stuff into algorithm, even if majority of things would only need things likemin
andmax
(fine, these would be easy to do manually) or things likecopy_n
(again trivial to do for simple things, but STL might have specializations for large loops w/ SIMD or whatever). On this machine, including algorithm and string results between 27 thousand and 35 thousand (depending on C++ language version enabled) non-whitespace lines of code.So I'd think that even putting these into PCHs to be used everywhere would be a good first step.
That said, I'll take a look at
REUSE_FROM
, indeed it would be better if we'd find a way to make it work.4fb1ccfec0
toee11f3a3fa
WIP: Build: add global precompiled headerto Build: add global precompiled headermore of a todo for my self (unless you want to look at this) but i'm getting
during a debug/vs ide build
Ah, looks like cmake generates flat out wrong MSVC project files, but only for the Debug config, and only for some projects 🤦 Seems that this is hitting "complex enough case that REUSE_FROM does not handle" from https://gitlab.kitware.com/cmake/cmake/-/issues/22630 -- I've pushed a commit that reverts to previous "each library just rebuilds their own pch" without using REUSE_FROM. Conceptually worse, but in my testing (on both Windows & Mac) that does not actually affect build time in a measurable way.
@blender-bot build
Checkout
From your project repository, check out a new branch and test the changes.