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
wip: make json serialization faster #4753
base: main
Are you sure you want to change the base?
Conversation
WASM Size
|
CodSpeed Performance ReportMerging #4753 will not alter performanceComparing Summary
|
1ebfa03
to
a268935
Compare
a268935
to
456f88e
Compare
According to the JSON RFC specification 84 there’s no restriction on the order of the keys. For example on Golang doesn’t care about the order of the keys and you always get a different ordering.: json.Marshal([]byte, interface{}) |
Hey @semoal, Thanks for your comment. I'm confused, you're the one who recently created an issue about having issues with the keys of json objects being out of order prisma/prisma#22479. Or did I misunderstand your issue? I wholeheartedly agree with you that we should not have to preserve that order. But you and other users have reported that it's breaking your app. This is not to accuse you of anything, to be clear. But this suggests that, despite the RFC, doing this change now would break a bunch of user's apps. So we need to take this into account before making this change without a major update. |
Yes, I've opened the issue but I understood that we were wrong assuming that. |
That's correct but this breaking change is currently behind a preview feature, which doesn't count as a "stable" breaking change. It's in fact the whole goal of preview features. We did plan on fixing that bug if it affected you, despite the RFC. With that being said, thanks a lot for chiming in and clarifying your thoughts. This may make the decision of not preserving object keys order easier. Have a great day 👍 |
Overview
Related to prisma/prisma#22596
Reduce JSON serialization overhead by:
Notes:
The connector is now responsible for:
The serializer is now only responsible, for join queries to discriminate values for the JSON protocol.
JSON keys order preservation is still costing us quite a lot of time, because it forces us to re-allocate all maps. I'm planning to open discussions as to whether we need to keep guaranteeing that the order of keys must be preserved.