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 rendering performance #39

Open
yisibl opened this issue Nov 2, 2021 · 3 comments · Fixed by #44
Open

Improve rendering performance #39

yisibl opened this issue Nov 2, 2021 · 3 comments · Fixed by #44

Comments

@yisibl
Copy link

yisibl commented Nov 2, 2021

For example, this file renders very slowly: https://commons.wikimedia.org/wiki/File:Anime_Girl.svg

Improvements: https://github.com/yisibl/resvg-js/blob/443d1c3de7cf2dc72c87299cb046e57621062654/Cargo.toml#L29-L34
This increases the size of the wasm file, but it improves rendering performance to some extent, and I think it's worth it.

Fundamentally, it may require upstream resvg to optimize.

This was referenced Nov 3, 2021
@ssssota
Copy link
Owner

ssssota commented Nov 5, 2021

@yisibl
I tried changing the build option.
There was indeed a slight speedup, but the conversion of Anime_Girl.svg is still significantly slower than resvg-js.

I will publish #44 , but I'm going to keep this issue open and proceed with the research.

@ssssota ssssota reopened this Nov 5, 2021
@yisibl
Copy link
Author

yisibl commented Nov 5, 2021

Yes, it's actually unfair to compare wasm with a library that generates binaries like resvg-js, wasm itself will have some overhead.

As a wasm library, we can just make a compromise between performance and file size.

@OpenGG
Copy link
Contributor

OpenGG commented Jan 4, 2022

The original svg takes forever to render with wasm. Not even possible to get a valid timeline profiling report.

I had to make smaller width/height:

viewBox="0 0 744 1052" height="100" width="142"

Timeline shows major cost in resvg::render::render_node and resvg::render::render_group.

timeline

timeline.tar.gz

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 a pull request may close this issue.

3 participants