Skip to content

Improved _assign_attribute implementation#70

Merged
matthinea merged 1 commit intomasterfrom
faster-attr-assignment
Oct 31, 2025
Merged

Improved _assign_attribute implementation#70
matthinea merged 1 commit intomasterfrom
faster-attr-assignment

Conversation

@matthinea
Copy link
Contributor

@matthinea matthinea commented Oct 30, 2025

Problem

See this commit in Rails. My own performance testing indicates that Platform DataImport performance is impacted by the described behavior.

Solution

Borrow from the more-performant, latest ActiveModel implementation of _assign_attribute. I tried removing this method override entirely at first and just relying on the ActiveModel implementation directly, but it turns out we're pretty reliant upon the "fail silently" behavior achieved by the respond_to? check.

@matthinea matthinea force-pushed the faster-attr-assignment branch from 913ea06 to a3d8a56 Compare October 31, 2025 00:36
@matthinea
Copy link
Contributor Author

Merging as there's no behavior change, and I'd like to see the performance implications.

@matthinea matthinea changed the title Just use ActiveModel's _assign_attribute Improved _assign_attribute implementation Oct 31, 2025
@matthinea matthinea merged commit 111f87e into master Oct 31, 2025
1 check failed
@matthinea matthinea requested a review from j1wilmot October 31, 2025 00:58
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.

1 participant