-
Notifications
You must be signed in to change notification settings - Fork 137
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
wpf caching mechanism #242
Comments
@dongzhaosheng73 Have you considered using threads? (see the public bool Load(Uri uriSource, bool useAsync = false) {}
public Task<bool> LoadAsync(Uri uriSource) {} |
Can asynchronous operations be done in xaml code? |
I do not know of any such possibility.
There should be a way out - but it sounds like purely WPF issue. I was also thinking of
|
I wonder if you can add a caching mechanism to svg controls, if the same resource exists in memory. similar to this microsoft article: https://learn.microsoft.com/en-us/windows/communitytoolkit/helpers/imagecache |
What do we cache in this case? (SvgDocument, Drawing, DrawingVisual) |
Would MemoryStream be any better? I think the performance bottleneck is in the IO operation, directly from the memory stream. |
Will not work well for all input types., and therefore not future proof. |
No matter what the input type is, I think they should be stored in memory as a stream type. It is hoped that a unified stream type cache can be made, and when verifying the input type content is consistent, the memory stream will be converted and output directly. |
There seems to be no gain in this choice. SvgDocument will always be created, why not simply cache that instead of converting to stream, which will again be converted to SvgDocument. In any case creating the SVG control is a simply process, you can even just copy all the source for your control of choice and add more features including the caching, and maybe post it as PR. |
I have found that repeatedly loading svg graphics can seriously affect UI performance and cause my interface to get stuck.
I don't know how to solve this situation, please help me.
The text was updated successfully, but these errors were encountered: