-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Use serde_json::Value is an intermediate state, and the performance of sea-orm will be lost #993
Comments
Hey @baoyachi, thanks for the digging! Internally, in SeaORM, we offer an let cake: Option<serde_json::Value> = Cake::find_by_id(1)
.into_json()
.one(db)
.await?;
assert_eq!(
cake,
Some(serde_json::json!({
"id": 1,
"name": "Cheese Cake"
}))
); https://www.sea-ql.org/SeaORM/docs/basic-crud/json/ The source code responsible for the conversion from |
I'm not sure if I answer your question. Is this a question that asking such conversion is possible or not? Or, this is a request for optimization of existing code? If so, could you point out the source code that needs to be refactor? |
I'm pretty sure I understand what @baoyachi means here (I found this issue through google). Lines 643 to 687 in 4584099
The implementation of For example, if I deserialize |
@main-- you are right |
@billy1624 How much performance will be improved? Is there a numerical result comparison? |
Is it possible to receive sqlx's Row object directly through the object for conversion without intervening serde_json::Value. At present, serde_json::Value is an intermediate state, and the performance of sea-orm will be lost.
The code like this:
The text was updated successfully, but these errors were encountered: