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

Optionally Turn off Kiota Backing Store #2563

Closed
grippstick opened this issue Jun 26, 2024 · 10 comments · Fixed by microsoft/kiota-dotnet#326
Closed

Optionally Turn off Kiota Backing Store #2563

grippstick opened this issue Jun 26, 2024 · 10 comments · Fixed by microsoft/kiota-dotnet#326
Assignees
Labels
Bug type:bug A broken experience type:regression A bug from previous release

Comments

@grippstick
Copy link

Is your feature request related to a problem? Please describe the problem.

When I download a very large Attachment, where the contentBytes are included, it is extremely slow, because of the Kiota Parsing.

Describe the solution you'd like.

I would like a way to tell the GraphClient to do a fast Deserialize that is not tracked.

Maybe something like
graphClient.Me.Messages[msgID].Attachments[attID].GetAsync(config => {config.DoNotTrack();})

Additional context?

No response

@grippstick grippstick added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels Jun 26, 2024
@rkodev rkodev added Status: Needs investigation status:needs-discussion An issue that requires more discussion internally before resolving and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Aug 12, 2024
@shemogumbe shemogumbe added status:waiting-for-triage An issue that is yet to be reviewed or assigned and removed Status: Needs investigation labels Aug 12, 2024
@baywet
Copy link
Member

baywet commented Aug 12, 2024

Hi @grippstick
Thank you for using the SDK and for reaching out.
Can you please provide more information?

  • What times are you seeing?
  • Have you tried unselecting the content bytes property if you don't need it?
  • How is the parsing problem related to the backing store itself in your view?

@grippstick
Copy link
Author

grippstick commented Aug 12, 2024 via email

@baywet
Copy link
Member

baywet commented Aug 12, 2024

Thank you for the additional information.

I have isolated it to the backing store by stepping through the code and seeing that it is trying to track every byte, which does not perform well with a 20Mb attachment.

Can you provide more context on this please? Or even a reproduction of the issue isolated from any network call if possible.

@grippstick
Copy link
Author

grippstick commented Aug 12, 2024 via email

@grippstick
Copy link
Author

grippstick commented Aug 12, 2024 via email

@baywet
Copy link
Member

baywet commented Aug 12, 2024

Thank you for the additional information.
You'll need to login to the GitHub web interface as the screenshots didn't make it through with the email.

@grippstick
Copy link
Author

image

image

@baywet baywet added Bug type:bug A broken experience type:regression A bug from previous release and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned status:needs-discussion An issue that requires more discussion internally before resolving type:feature New experience request labels Aug 12, 2024
@baywet
Copy link
Member

baywet commented Aug 12, 2024

Thank you for the additional information.
I was able to isolate the issue and put a pull request together to address it.
microsoft/kiota-dotnet#326

@grippstick
Copy link
Author

I can confirm that it is much faster than it was, but it is still very slow with the parsing.

This call has gone from 7 seconds to 3.5 seconds.

await graphClient.Me
                                         .Messages[msgID]
                                         .Attachments[attID]
                                         .GetAsync(config =>
                                         {
                                             config.WithImmutableId();
                                         }).ConfigureAwait(false); 

A direct call to MsGraphHttpClient.SendAsync(httpRequest)
takes 1.5 seconds, then it parses in <30ms.

I can see that the network portion of this is about 1.5 seconds, which means kiota is still taking 2 seconds to parse contentBytes.

Doing another cpu profile I can see that the majority of the slowness is coming from InMemoryBackingStore.Set, because it is still looping through every byte of the contentBytes.

image

image

image

@baywet
Copy link
Member

baywet commented Aug 14, 2024

Thanks for the follow up here, authored microsoft/kiota-dotnet#328 to address this additional issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug type:bug A broken experience type:regression A bug from previous release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants