-
Notifications
You must be signed in to change notification settings - Fork 220
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
Make types Send + Sync #544
Comments
Which types? We have hundreds of them. Also, why? What exactly are you doing in parallel? resvg/usvg are strictly single-threaded. |
Well I was specifically targeting
Even if |
Ok, I saw your rctree fork. I'm sorry, but this is not a solution. rctree uses Why you cannot simply put the whole Also, I never used async once in Rust, so I have no idea how it should even be handled. For now, this is a caller problem, not the library one. |
Alright. I thought I might get a response like this but I thought you deserved a chance to at least consider it. |
I also ran into this (working branch). If large SVG (or several small SVGs) need(s) resizing it would be nice to do the drawing without blocking the program, but there are only a few options:
Note: saying no to this request is still a perfectly valid option. Arguably I should be using GPU-accelerated rendering anyway for my use-case (GUI toolkit). |
My position on this issue is still the same: resvg isn't designed for a multi-threaded use case. If you want to render many files - parse them in the same thread. Parsing is usually way faster than rendering, so it's not a performance bottleneck. SVG, in general, is a horrible format. If you need dynamic content - use something else (probably custom) or use Basically, there are no benefits in making resvg "thread-safe". |
My use-case ends up re-rendering any time the (window) size changes, otherwise it simply draws from the texture.
😆 |
I can probably write a book about how bad SVG is. And probably will, someday. As for rendering, SVG isn't designed for fast rendering by design. On top of that, Overall, you cannot render SVG at 60 FPS even on GPU. Not generic vector graphics, SVG specifically. Mainly due to patterns, masking and filters. As for your specific use case, maybe the new render tree in |
The sendable crate is dedicated to solving this problem (like For my purposes an |
I have a couple branches where I did this. Tests still pass and as far as I can tell there's no performance penalty. I'll open a PR if you're interested in reviewing it.
The text was updated successfully, but these errors were encountered: