Skip to content

Conversation

@MaxAake
Copy link
Contributor

@MaxAake MaxAake commented Oct 15, 2025

The toStructure function is run on every element being sent over bolt, which loops over all available typeTransformers and checks if they're valid for transforming what is being sent to a structure. This is rather wasteful for things like strings and numbers, which we do not have any transformers for.

Based on a suggestion in #1351, the improvement will only work for as long as we do not have any transformers for primitive types, but there are currently no plans which would require that.

@MaxAake MaxAake marked this pull request as draft October 15, 2025 09:41
@MaxAake MaxAake changed the title add quick exit in toStructure() for primitive types add quick return in toStructure() for primitive values Oct 15, 2025
@MaxAake MaxAake marked this pull request as ready for review October 16, 2025 12:03
Copy link
Contributor

@StephenCathcart StephenCathcart left a comment

Choose a reason for hiding this comment

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

👍

@MaxAake MaxAake merged commit 636a908 into 6.x Oct 20, 2025
48 checks passed
@MaxAake MaxAake deleted the speed-up-transformers branch October 20, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants