Skip to content
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

fix(cubesql): Don't clone response, improve performance #8638

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

ovr
Copy link
Member

@ovr ovr commented Aug 26, 2024

serde_json::from_value requires passing the own of the value; it's why we used clone here. The biggest problem is that we used it for successful responses, which is a large structure.

PR fixes that issue.

@ovr ovr requested a review from a team as a code owner August 26, 2024 18:06
Copy link

vercel bot commented Aug 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-angular-dashboard ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:21pm
examples-react-d3 ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:21pm
examples-react-dashboard ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:21pm
examples-react-data-table ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:21pm
examples-react-highcharts ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:21pm
examples-react-material-ui ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:21pm
examples-react-pivot-table ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:21pm
examples-vue-query-builder ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:21pm

#[cfg(debug_assertions)]
trace!("[transport] Request <- {:?}", response);
#[cfg(not(debug_assertions))]
trace!("[transport] Request <- <hidden>");

let load_err = match serde_json::from_value::<TransportLoadResponse>(response.clone()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serde_json::from_value requires passing the own of the value; it's why we used clone here. The biggest problem is that we used it for successful responses, which is a large structure.

PR fixes that issue.

Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.50%. Comparing base (b4754db) to head (cecaed0).
Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8638   +/-   ##
=======================================
  Coverage   82.50%   82.50%           
=======================================
  Files         209      209           
  Lines       76718    76718           
=======================================
  Hits        63300    63300           
  Misses      13418    13418           
Flag Coverage Δ
cubesql 82.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ovr ovr merged commit 4366299 into master Aug 27, 2024
65 checks passed
@ovr ovr deleted the fix/native-dont-clone-response branch August 27, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant