Core: Remove class_db.h include from ref_counted.h#116737
Merged
Repiteo merged 1 commit intogodotengine:masterfrom Feb 27, 2026
Merged
Core: Remove class_db.h include from ref_counted.h#116737Repiteo merged 1 commit intogodotengine:masterfrom
class_db.h include from ref_counted.h#116737Repiteo merged 1 commit intogodotengine:masterfrom
Conversation
801d941 to
137971f
Compare
137971f to
befd7d8
Compare
befd7d8 to
a14190b
Compare
a14190b to
abdde1b
Compare
This was referenced Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
Reftemplates forPtrToArg,GetTypeInfo, andVariantInternalAccessorwere migrated to the original headers, as there's no longer a risk of circular includes.ClassDBdirectly had their logic migrated to implementation files.I know there's been hesitation in the past about tackling the removal of
class_db.hincludes1, but I think the changes here demonstrate that this warrants revisiting. Even after migratingClassDBlogic to implementation files, many headers & implementation files alike still needed additional includes. This is because several of the affected files weren't forObjectsubclasses at all; plenty of utilities were includingclass_db.hindirectly!This isn't even mentioning the current cost of these includes.
class_db.handref_counted.hboth rank in the top 5 of fresh compile and recompile times. WhileObjectandVariantare likely the two "real" compile-time culprits,Refwasn't helping matters with a direct include ofClassDB. So while it'll likely still rank fairly high, it's feasible that this change alone could dethroneref_counted.has the single most expensive file from a fresh compilation.Footnotes
https://github.com/godotengine/godot/pull/111573#pullrequestreview-3330940683 ↩