-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to Panko serializers #22378
Comments
Can you post your detailed stats to backup your claim? Core infra changes are hard, but if you can give concrete numbers it helps with your suggestion |
not that it's my business, but I found https://panko.dev/docs/performance; I know those are just benchmarks, implementing and testing might be a fair bit of work (do you have a way to benchmark commonly used methods?) |
I poked around with this in main...darronschall:mastodon:panko-benchmark-tag-serializer I focused on the
I suspect the results will be more dramatic when more work is done. The real test will be converting |
Quick addendum. I added another benchmark to use Panko's
Your results may vary. I have an M1 MacBook Pro. All that said, I'm leaning towards pursuing this a little bit further and publishing my |
Pitch
Mastodon poor performance is basically a meme. You would expect the bottleneck to be the database. Well, in my tests the culprit is actually the ActiveModel Serializer, which is not producing json fast enough AFTER retrieving from the database. That is funny and stupid.
The solution is to switch to Panko for serialization. This cuts response times up to 3x. Fortunately the API is quite similar to ActiveModel, and you can use both in a project while incrementally adopting it.
Motivation
Mastodon is faster for users, the world no longer suffers the carbon emissions of ActiveModel Serializer.
The text was updated successfully, but these errors were encountered: