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

Improve load time on serialized entries. #67370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brtal
Copy link

@brtal brtal commented May 11, 2024

From profiling slow load times of serialized GPUv2 delegate data, a lot of unnecessary time is spent re-allocating memory as part of the call to std::string::append. By pre-allocating the correct size, we save a lot of time.

This patch was developed in 2022 (pardon the slow turn-around) and I no longer have the exact profiling details. However, my notes say that on an arbitrary but complex model, GetData() was previously taking 50ms; with this patch, it takes 18ms.

From profiling slow load times of serialized GPUv2 delegate data, a lot of unnecessary time is spent re-allocating memory as part of the call to std::string::append. By pre-allocating the correct size, we save a lot of time.

This patch was developed in 2022 (pardon the slow turn-around) and I no longer have the exact profiling details. However, my notes say that on an arbitrary but complex model, GetData() was previously taking 50ms; with this patch, it takes 18ms.
@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label May 11, 2024
Copy link

google-cla bot commented May 11, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gbaned gbaned added the comp:lite TF Lite related issues label May 14, 2024
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation May 14, 2024
@gbaned gbaned requested a review from majiddadashi May 14, 2024 03:36
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label May 14, 2024
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer May 22, 2024
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels May 22, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label May 22, 2024
@gbaned
Copy link
Contributor

gbaned commented May 23, 2024

Hi @brtal Can you please sign CLA? Thank you!

@gbaned gbaned added stat:awaiting response Status - Awaiting response from author and removed awaiting review Pull request awaiting review ready to pull PR ready for merge process labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues size:S CL Change Size: Small stat:awaiting response Status - Awaiting response from author
Projects
PR Queue
  
Approved by Reviewer
Development

Successfully merging this pull request may close these issues.

None yet

4 participants