Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(56)

Issue 6533048: code review 6533048: compress/flate: move the history buffer out of the deco... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by nigeltao
Modified:
11 years, 6 months ago
Reviewers:
CC:
rsc, r, golang-dev
Visibility:
Public.

Description

compress/flate: move the history buffer out of the decompressor struct. I'm not exactly sure why there's a performance gain, but it seems like an easy win. Maybe it's a cache line thing. Maybe it's that unsafe.Sizeof(decompressor{}) drops to below unmappedzero, so that checkref/checkoffset don't need to insert TESTB instructions. Maybe it's less noise for the conservative garbage collector. Maybe it's something else. compress/flate benchmarks: BenchmarkDecodeDigitsSpeed1e4 378628 349906 -7.59% BenchmarkDecodeDigitsSpeed1e5 3481976 3204898 -7.96% BenchmarkDecodeDigitsSpeed1e6 34419500 31750660 -7.75% BenchmarkDecodeDigitsDefault1e4 362317 335562 -7.38% BenchmarkDecodeDigitsDefault1e5 3290032 3107624 -5.54% BenchmarkDecodeDigitsDefault1e6 30542540 28937480 -5.26% BenchmarkDecodeDigitsCompress1e4 362803 335158 -7.62% BenchmarkDecodeDigitsCompress1e5 3294512 3114526 -5.46% BenchmarkDecodeDigitsCompress1e6 30514940 28927090 -5.20% BenchmarkDecodeTwainSpeed1e4 412818 389521 -5.64% BenchmarkDecodeTwainSpeed1e5 3475780 3288908 -5.38% BenchmarkDecodeTwainSpeed1e6 33629640 31931420 -5.05% BenchmarkDecodeTwainDefault1e4 369736 348850 -5.65% BenchmarkDecodeTwainDefault1e5 2861050 2721383 -4.88% BenchmarkDecodeTwainDefault1e6 27120120 25862050 -4.64% BenchmarkDecodeTwainCompress1e4 372057 350822 -5.71% BenchmarkDecodeTwainCompress1e5 2855109 2718664 -4.78% BenchmarkDecodeTwainCompress1e6 26987010 26336030 -2.41% image/png benchmarks: BenchmarkDecodeGray 1841839 1802251 -2.15% BenchmarkDecodeNRGBAGradient 7115318 6933280 -2.56% BenchmarkDecodeNRGBAOpaque 6135892 6013284 -2.00% BenchmarkDecodePaletted 1153313 1114302 -3.38% BenchmarkDecodeRGB 5619404 5511190 -1.93%

Patch Set 1 #

Patch Set 2 : diff -r 7af3dbecf445 https://code.google.com/p/go #

Patch Set 3 : diff -r 7af3dbecf445 https://code.google.com/p/go #

Patch Set 4 : diff -r 7c53f5b1e1bf https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -3 lines) Patch
M src/pkg/compress/flate/inflate.go View 1 3 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 5
nigeltao
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 7 months ago (2012-09-19 02:56:05 UTC) #1
r
i'd be curious how it compares if the buffer was the last field of the ...
11 years, 7 months ago (2012-09-19 03:00:18 UTC) #2
r
(as an array again)
11 years, 7 months ago (2012-09-19 03:00:38 UTC) #3
nigeltao
On 19 September 2012 13:00, <r@golang.org> wrote: > i'd be curious how it compares if ...
11 years, 7 months ago (2012-09-19 03:09:25 UTC) #4
nigeltao
11 years, 6 months ago (2012-09-24 07:58:18 UTC) #5
*** Submitted as http://code.google.com/p/go/source/detail?r=3d7777fe2e8a ***

compress/flate: move the history buffer out of the decompressor struct.

I'm not exactly sure why there's a performance gain, but it seems like
an easy win. Maybe it's a cache line thing. Maybe it's that
unsafe.Sizeof(decompressor{}) drops to below unmappedzero, so that
checkref/checkoffset don't need to insert TESTB instructions. Maybe
it's less noise for the conservative garbage collector. Maybe it's
something else.

compress/flate benchmarks:
BenchmarkDecodeDigitsSpeed1e4          378628       349906   -7.59%
BenchmarkDecodeDigitsSpeed1e5         3481976      3204898   -7.96%
BenchmarkDecodeDigitsSpeed1e6        34419500     31750660   -7.75%
BenchmarkDecodeDigitsDefault1e4        362317       335562   -7.38%
BenchmarkDecodeDigitsDefault1e5       3290032      3107624   -5.54%
BenchmarkDecodeDigitsDefault1e6      30542540     28937480   -5.26%
BenchmarkDecodeDigitsCompress1e4       362803       335158   -7.62%
BenchmarkDecodeDigitsCompress1e5      3294512      3114526   -5.46%
BenchmarkDecodeDigitsCompress1e6     30514940     28927090   -5.20%
BenchmarkDecodeTwainSpeed1e4           412818       389521   -5.64%
BenchmarkDecodeTwainSpeed1e5          3475780      3288908   -5.38%
BenchmarkDecodeTwainSpeed1e6         33629640     31931420   -5.05%
BenchmarkDecodeTwainDefault1e4         369736       348850   -5.65%
BenchmarkDecodeTwainDefault1e5        2861050      2721383   -4.88%
BenchmarkDecodeTwainDefault1e6       27120120     25862050   -4.64%
BenchmarkDecodeTwainCompress1e4        372057       350822   -5.71%
BenchmarkDecodeTwainCompress1e5       2855109      2718664   -4.78%
BenchmarkDecodeTwainCompress1e6      26987010     26336030   -2.41%

image/png benchmarks:
BenchmarkDecodeGray               1841839      1802251   -2.15%
BenchmarkDecodeNRGBAGradient      7115318      6933280   -2.56%
BenchmarkDecodeNRGBAOpaque        6135892      6013284   -2.00%
BenchmarkDecodePaletted           1153313      1114302   -3.38%
BenchmarkDecodeRGB                5619404      5511190   -1.93%

R=rsc, r
CC=golang-dev
http://codereview.appspot.com/6533048
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b