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

Memory optimization #42

Closed
wolfgangmeyers opened this issue Jul 5, 2018 · 2 comments
Closed

Memory optimization #42

wolfgangmeyers opened this issue Jul 5, 2018 · 2 comments

Comments

@wolfgangmeyers
Copy link

Hello,

I've been working on optimizing the memory of an application I am working on, and I noticed that the context.Fill method creates a new Rasterizer each time it is called. This probably isn't noticeable in most use cases, but in my case the rendering is being used very heavily, and I noticed a lot of the memory allocation in my application came from this method:

https://github.com/fogleman/gg/blob/master/context.go#L397

Would it be possible to reuse the rasterizer for multiple calls to Fill ?

@fogleman
Copy link
Owner

fogleman commented Jul 5, 2018

That should be possible. Feel free to submit a PR or I can try to do it later (currently on vacation!)

@wolfgangmeyers
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants