rails-api / active_model_serializers

ActiveModel::Serializer implementation and Rails hooks
MIT License
5.32k stars 1.39k forks source link

[0.9 stable] Improve shape friendliness of ActionController::Serialization #2463

Closed casperisfine closed 2 months ago

casperisfine commented 2 months ago

Lazily defining instance variable can significantly increase the number of shapes on Ruby 3.2+ which isn't good for performance.

Extracted from: https://github.com/rails-api/active_model_serializers/pull/2461

cc @bf4