Skip to content

Commit 6e88ae2

Browse files
authored
Inline register_type_data to cut down on binary size (#22030)
# Objective My [TypeData dependencies](#22016 ) PR regressed native binary size by ~8mb. (thank you [twitcher](https://github.com/bevyengine/twitcher/)) <img width="858" height="306" alt="image" src="https://github.com/user-attachments/assets/e6d86c67-33f6-4280-bee4-49771014b678" /> ## Solution - Inline `register_type_data`, which restores the original binary size: - `release breakout` before #22016: 127.3mb - `release breakout` after #22016: 136.4mb - `release breakout` after this PR: 127.4mb
1 parent e8520c1 commit 6e88ae2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/bevy_reflect/src/type_registry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ impl TypeRegistration {
590590

591591
/// Inserts the [`TypeData`] instance of `T` created for `V`, and inserts any
592592
/// [`TypeData`] dependencies for that combination of `T` and `V`.
593+
#[inline]
593594
pub fn register_type_data<T: TypeData + FromType<V>, V>(&mut self) {
594595
self.insert(T::from_type());
595596
T::insert_dependencies(self);

0 commit comments

Comments
 (0)