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

Speed up SVG thumbnail rendering #28811

Closed
infacto opened this issue Sep 27, 2023 · 3 comments
Closed

Speed up SVG thumbnail rendering #28811

infacto opened this issue Sep 27, 2023 · 3 comments
Labels
Issue-Feature A planned feature addition to a product Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Product-File Explorer Power Toys that touch explorer like Preview Pane

Comments

@infacto
Copy link

infacto commented Sep 27, 2023

Enhancement

The SVG thumbnail preview is great and useful. It should be built-in Windows by default (as other OS already do).

I just wish the rendering was a lot faster than it is now. Currently it is rendering for about 1 second sequential. Ca. 1 minute per 60 files. I'm wondering if we can parallelize it or improve it in some other way.

demo

@infacto infacto added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Sep 27, 2023
@yuyoyuppe
Copy link
Collaborator

Hi, the generator is called by the OS, so we cannot parallelize this code.

Does it happen with older PowerToys versions as well, though? Perhaps it's a slowdown that was introduced by the recent changes.

/needinfo

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Sep 28, 2023
@yuyoyuppe yuyoyuppe added Product-File Explorer Power Toys that touch explorer like Preview Pane Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Issue-Feature A planned feature addition to a product and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 28, 2023
@infacto
Copy link
Author

infacto commented Sep 28, 2023

I tested in 0.6x.x and 0.74.0 and can't see any difference. Can you reproduce it on your version? Otherwise, I can test this on another PC... I don't know how to measure what's slow here. Either the OS API or the renderer. You noticed in another issue that MS Edge is used to render the SVG. But in browser the rendering is not that slow. Even though vector graphics are more complex than pixel graphics, it would be great if we can improve the speed...

@yuyoyuppe
Copy link
Collaborator

yuyoyuppe commented Sep 28, 2023

Thank you for the testing @infacto! I can reproduce the issue, but it's very hard for us to fix - the reason it's slow is that the OS calls our thumbnail generator like this:

for(file in directory)
  generate_thumbnail(file);

instead of this:

for(file in directory)
  task.spawn(generate_thumbnail(file)); // doesn't wait until finished

The reason it's faster in the actual browser because the browser doesn't need to go into full initialization process like we do in our generator. The alternative is to always have a background service with a browser initialized, but that approach has a lot of drawbacks as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature A planned feature addition to a product Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Product-File Explorer Power Toys that touch explorer like Preview Pane
Projects
None yet
Development

No branches or pull requests

2 participants