You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I forked and patched it up so its AT LEAST twice faster ... and a lot more for larger serializer, results running against Ruby 2.0 are here (benchmark is in the benchmark folder)
Note, there is still room for improvement, the "if" checks can be omitted in the serializer generated if code is restructures a bit, also I think a method call can be erased. eg go directly to the object instead of bridging for certain cases.
Note, there is still room for improvement, the "if" checks can be omitted in the serializer generated if code is restructures a bit, also I think a method call can be erased. eg go directly to the object instead of bridging for certain cases.
—
Reply to this email directly or view it on GitHub.
While profiling Discourse with DTRACE I have notices a very large amount of time is being spent inside AM::Serializer iterating through hashes etc.
My fork is at: https://github.com/SamSaffron/active_model_serializers
I forked and patched it up so its AT LEAST twice faster ... and a lot more for larger serializer, results running against Ruby 2.0 are here (benchmark is in the benchmark folder)
The "fast_attributes" method is a direct drop in:
The other fix which has MAJOR perf benefits is stripping out the excessive instrumentation.
My recommendation here would be not to be doing any instrumentation in
If people would like instrumentation let them opt in with.
ActiveModel::Serializer.enable_instrumentation!
With both fixes in place real time goes down from 983ms to 356ms ... a pretty significant change.
Let me know if you are ok with both and I will turn this into a PR.
The text was updated successfully, but these errors were encountered: