-
Notifications
You must be signed in to change notification settings - Fork 18k
image/draw: optimize DrawMask when drawing a Uniform Image onto a Paletted Image #35938
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
Comments
Difference in speed between current version and proposed change: Current Version: Took: 3.722995689s for 4000000 points - 1074403.607777 pps With Change: Took: 3.170383ms for 4000000 points - 1261677216.916694 pps |
@bradfitz |
@nigeltao primarily owns image/*. |
Proposed fix looks fine for whenever the Go 1.15 tree opens, after the Go 1.14 release. The recommended process for contributing patches is documented at Or, if you're happy without formal authorship attribution, in terms of the Author field in the git log, I'm happy to send out the code review with this fix. |
@nigeltao - I'm fine without formal authorship but I will look into following the recommended process in the future. |
Change https://golang.org/cl/230118 mentions this issue: |
name old time/op new time/op delta PalettedFill-4 5.74ms ± 1% 0.01ms ± 1% -99.78% (p=0.008 n=5+5) PalettedRGBA-4 3.34ms ± 3% 3.33ms ± 0% ~ (p=0.690 n=5+5) Fixes golang#35938 Thanks to pjbgtnj for the suggestion. Change-Id: I07b494482cce918f556e196c5a4b481b4c16de3a Reviewed-on: https://go-review.googlesource.com/c/go/+/230118 Run-TryBot: Nigel Tao <nigeltao@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
What version of Go are you using (
go version
)? 1.13.4Does this issue reproduce with the latest release?
Yes - and github master branch too
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Wrote a program that ran much slower than expected. The following program will reproduce the slow speed:
What did you expect to see?
It should run very quickly, not take several seconds. The DrawMask function in image/draw/draw.go is called a lot for the specific application I'm working with and this is the bottleneck.
What did you see instead?
I expected it to run nearly instantly
Here is a proposed fix:
The text was updated successfully, but these errors were encountered: