Skip to content

Conversation

@molikto
Copy link
Contributor

@molikto molikto commented Jan 19, 2026

Objective

After #22452 is merged, the binary size increased a lot (and also compile time). Try to decrease binary size again.

Solution

Change the methods from generic to non-generic.

Testing

compile 3d_shapes example on macOS:

also tried to see what if we disable reflection based cmp/eq entirely (which makes tests fails):

  • disable reflection based cmp/eq entirely: 94.1mb

@alice-i-cecile alice-i-cecile added this to the 0.19 milestone Jan 19, 2026
@alice-i-cecile alice-i-cecile added C-Performance A change motivated by improving speed, memory usage or compile times C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Jan 19, 2026
Copy link
Member

@MrGVSV MrGVSV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone with more compiler knowledge will probably have more insight as to whether inline(never) is "correct" here (I would assume so as we don't really want these functions to be inlined).

But otherwise makes sense to me! I think whatever tradeoff in performance we have to make here is worth it to reduce binary size, since users can always register their actual implementations to avoid these functions from being called at all.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 20, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 20, 2026
Merged via the queue into bevyengine:main with commit 8f79dbe Jan 20, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Reflection Runtime information about types C-Performance A change motivated by improving speed, memory usage or compile times S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants