Go to file
Nigel Tao c53fa16781 draw: use a sync.Pool for kernel scaling's temporary buffers.
benchmark                      old ns/op     new ns/op     delta
BenchmarkScaleBLLargeDown      257715146     260286012     +1.00%
BenchmarkScaleCRLargeDown      426797448     430078734     +0.77%
BenchmarkScaleBLDown           4449939       4222542       -5.11%
BenchmarkScaleCRDown           8160446       8010056       -1.84%
BenchmarkScaleBLUp             22290312      21044122      -5.59%
BenchmarkScaleCRUp             33010722      32021468      -3.00%
BenchmarkScaleCRSrcGray        13307961      13020192      -2.16%
BenchmarkScaleCRSrcNRGBA       40567431      40801939      +0.58%
BenchmarkScaleCRSrcRGBA        39892971      40240558      +0.87%
BenchmarkScaleCRSrcYCbCr       59020222      59686699      +1.13%

benchmark                      old allocs     new allocs     delta
BenchmarkScaleBLLargeDown      1              1              +0.00%
BenchmarkScaleCRLargeDown      1              2              +100.00%
BenchmarkScaleBLDown           1              0              -100.00%
BenchmarkScaleCRDown           1              0              -100.00%
BenchmarkScaleBLUp             1              0              -100.00%
BenchmarkScaleCRUp             1              0              -100.00%
BenchmarkScaleCRSrcGray        1              0              -100.00%
BenchmarkScaleCRSrcNRGBA       1              0              -100.00%
BenchmarkScaleCRSrcRGBA        1              0              -100.00%
BenchmarkScaleCRSrcYCbCr       1              0              -100.00%

benchmark                      old bytes     new bytes     delta
BenchmarkScaleBLLargeDown      14745600      2949200       -80.00%
BenchmarkScaleCRLargeDown      14745600      4915333       -66.67%
BenchmarkScaleBLDown           1523712       5079          -99.67%
BenchmarkScaleCRDown           1523712       7619          -99.50%
BenchmarkScaleBLUp             10117120      101175        -99.00%
BenchmarkScaleCRUp             10117120      202350        -98.00%
BenchmarkScaleCRSrcGray        4915200       49156         -99.00%
BenchmarkScaleCRSrcNRGBA       4915200       163853        -96.67%
BenchmarkScaleCRSrcRGBA        4915200       163853        -96.67%
BenchmarkScaleCRSrcYCbCr       4915200       245780        -95.00%

The increase in BenchmarkScale??LargeDown number of allocs I think is an
accounting error due to the low number of iterations: a low denominator.
I suspect that there are one or two extra allocs up front for using the
sync.Pool, but one fewer alloc per iteration. The number of iterations
is only 5 for BL and 3 for CR, for the default timeout. If I increase
the -test.benchtime value to 5s, then the reported average (allocs/op)
drop from 2 to 0, so the delta should actually be -100% instead of +0 or
+100%.

Change-Id: I21d9bb0086bdb25517b6a430e8a21bdf3db026f6
Reviewed-on: https://go-review.googlesource.com/8150
Reviewed-by: Rob Pike <r@golang.org>
2015-04-02 05:39:46 +00:00
bmp image: add import comments. 2014-12-09 22:43:18 +00:00
cmd/webp-manual-test image: add import comments. 2014-12-09 22:43:18 +00:00
draw draw: use a sync.Pool for kernel scaling's temporary buffers. 2015-04-02 05:39:46 +00:00
math math/f32, math/f64: add a comment that "Aff" stands for affine 2015-03-06 02:15:01 +00:00
riff image: add import comments. 2014-12-09 22:43:18 +00:00
testdata draw: update the inlined YCbCr.RGBA code to use 16 bit color. 2015-03-26 22:31:54 +00:00
tiff image: add import comments. 2014-12-09 22:43:18 +00:00
vp8 image: add import comments. 2014-12-09 22:43:18 +00:00
vp8l image: add import comments. 2014-12-09 22:43:18 +00:00
webp image: add import comments. 2014-12-09 22:43:18 +00:00
.gitattributes image: copying .gitattributes to all subrepositories 2014-12-23 11:05:35 +00:00
.gitignore convert .hgignore to .gitignore. 2014-12-08 10:42:30 +11:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
codereview.cfg image: add codereview.cfg 2015-03-18 17:04:05 +00:00
CONTRIBUTING.md doc: add CONTRIBUTING.md 2015-02-20 05:00:47 +00:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:31 +11:00
PATENTS go.image: add PATENTS file to the subrepo. 2012-04-16 11:25:02 +10:00
README go.image: initial code. 2012-01-31 11:32:50 +11:00

This repository holds supplementary Go image libraries.

To submit changes to this repository, see http://golang.org/doc/contribute.html.