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

Issue 6782072: code review 6782072: crypto/md5: speed up aligned writes and test/bench unal... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by minux1
Modified:
11 years, 4 months ago
Reviewers:
CC:
golang-dev, dfc, bradfitz
Visibility:
Public.

Description

crypto/md5: speed up aligned writes and test/bench unaligned writes Write() can safely use uint32 loads when input is aligned. Also add test and benchmarks for unaligned writes. Benchmark result obtained by Dave Cheney on ARMv5TE @ 1.2GHz: benchmark old ns/op new ns/op delta BenchmarkHash8Bytes 4104 3417 -16.74% BenchmarkHash1K 22061 11208 -49.20% BenchmarkHash8K 146630 65148 -55.57% BenchmarkHash8BytesUnaligned 4128 3436 -16.76% BenchmarkHash1KUnaligned 22054 21473 -2.63% BenchmarkHash8KUnaligned 146658 146909 +0.17% benchmark old MB/s new MB/s speedup BenchmarkHash8Bytes 1.95 2.34 1.20x BenchmarkHash1K 46.42 91.36 1.97x BenchmarkHash8K 55.87 125.74 2.25x BenchmarkHash8BytesUnaligned 1.94 2.33 1.20x BenchmarkHash1KUnaligned 46.43 47.69 1.03x BenchmarkHash8KUnaligned 55.86 55.76 1.00x

Patch Set 1 #

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

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

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

Patch Set 5 : diff -r 591fc8a0131a https://code.google.com/p/go #

Patch Set 6 : diff -r 5eee09217fcd https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -8 lines) Patch
M src/pkg/crypto/md5/gen.go View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/crypto/md5/md5_test.go View 1 2 3 4 4 chunks +34 lines, -8 lines 0 comments Download
M src/pkg/crypto/md5/md5block.go View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 5
dfc
LGTM.
11 years, 4 months ago (2012-11-15 07:27:35 UTC) #1
minux1
Hello golang-dev@googlegroups.com, dave@cheney.net (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 4 months ago (2012-11-15 11:01:55 UTC) #2
dfc
On 2012/11/15 11:01:55, minux wrote: > Hello mailto:golang-dev@googlegroups.com, mailto:dave@cheney.net (cc: > mailto:golang-dev@googlegroups.com), > > I'd ...
11 years, 4 months ago (2012-11-16 10:10:12 UTC) #3
bradfitz
LGTM On Nov 16, 2012 2:10 AM, <dave@cheney.net> wrote: > On 2012/11/15 11:01:55, minux wrote: ...
11 years, 4 months ago (2012-11-16 12:50:40 UTC) #4
minux1
11 years, 4 months ago (2012-11-17 18:25:58 UTC) #5
*** Submitted as http://code.google.com/p/go/source/detail?r=8d4694744c40 ***

crypto/md5: speed up aligned writes and test/bench unaligned writes
Write() can safely use uint32 loads when input is aligned.
Also add test and benchmarks for unaligned writes.

Benchmark result obtained by Dave Cheney on ARMv5TE @ 1.2GHz:
benchmark                       old ns/op    new ns/op    delta
BenchmarkHash8Bytes                  4104         3417  -16.74%
BenchmarkHash1K                     22061        11208  -49.20%
BenchmarkHash8K                    146630        65148  -55.57%
BenchmarkHash8BytesUnaligned         4128         3436  -16.76%
BenchmarkHash1KUnaligned            22054        21473   -2.63%
BenchmarkHash8KUnaligned           146658       146909   +0.17%

benchmark                        old MB/s     new MB/s  speedup
BenchmarkHash8Bytes                  1.95         2.34    1.20x
BenchmarkHash1K                     46.42        91.36    1.97x
BenchmarkHash8K                     55.87       125.74    2.25x
BenchmarkHash8BytesUnaligned         1.94         2.33    1.20x
BenchmarkHash1KUnaligned            46.43        47.69    1.03x
BenchmarkHash8KUnaligned            55.86        55.76    1.00x

R=golang-dev, dave, bradfitz
CC=golang-dev
http://codereview.appspot.com/6782072
Sign in to reply to this message.

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