FAQ
Reviewers: golang-dev1,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://code.google.com/p/go


Description:
crypto/md5: native arm assembler version

An ARM version of md5block.go with a big improvement in
throughput (up to 150%) and a reduction in object size (21%).

Code size

    Before 3100 bytes
    After 2440 bytes
    21% smaller

Benchmarks

Before on Raspberry PI

PASS
BenchmarkHash8Bytes 200000 11703 ns/op
    0.68 MB/s 64 B/op 1 allocs/op
BenchmarkHash1K 50000 38057 ns/op
   26.91 MB/s 128 B/op 2 allocs/op
BenchmarkHash8K 10000 208131 ns/op
   39.36 MB/s 128 B/op 2 allocs/op
BenchmarkHash8BytesUnaligned 200000 11457 ns/op
    0.70 MB/s 64 B/op 1 allocs/op
BenchmarkHash1KUnaligned 50000 69334 ns/op
   14.77 MB/s 128 B/op 2 allocs/op
BenchmarkHash8KUnaligned 5000 455120 ns/op
   18.00 MB/s 128 B/op 2 allocs/op

After on Raspberry PI

PASS
BenchmarkHash8Bytes 500000 7091 ns/op
    1.13 MB/s +66% 0 B/op 0 allocs/op
BenchmarkHash1K 100000 22469 ns/op
   45.57 MB/s +69% 0 B/op 0 allocs/op
BenchmarkHash8K 10000 144155 ns/op
   56.83 MB/s +44% 0 B/op 0 allocs/op
BenchmarkHash8BytesUnaligned 500000 7025 ns/op
    1.14 MB/s +62% 0 B/op 0 allocs/op
BenchmarkHash1KUnaligned 100000 27727 ns/op
   36.93 MB/s +150% 0 B/op 0 allocs/op
BenchmarkHash8KUnaligned 10000 185963 ns/op
   44.05 MB/s +140% 0 B/op 0 allocs/op

This also adds another test which makes sure that the sums
over larger blocks work properly. I wrote this test when I was
worried about memory corruption.

Please review this at https://codereview.appspot.com/11648043/

Affected files:
    M src/pkg/crypto/md5/gen.go
    M src/pkg/crypto/md5/md5_test.go
    M src/pkg/crypto/md5/md5block.go
    A src/pkg/crypto/md5/md5block_arm.s
    M src/pkg/crypto/md5/md5block_decl.go


--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dave Cheney at Jul 21, 2013 at 8:00 am
    Protip, misc/benchcmp before.txt after.txt


    On 21/07/2013, at 17:55, nickcw@gmail.com wrote:

    Reviewers: golang-dev1,

    Message:
    Hello golang-dev@googlegroups.com,

    I'd like you to review this change to
    https://code.google.com/p/go


    Description:
    crypto/md5: native arm assembler version

    An ARM version of md5block.go with a big improvement in
    throughput (up to 150%) and a reduction in object size (21%).

    Code size

    Before 3100 bytes
    After 2440 bytes
    21% smaller

    Benchmarks

    Before on Raspberry PI

    PASS
    BenchmarkHash8Bytes 200000 11703 ns/op
    0.68 MB/s 64 B/op 1 allocs/op
    BenchmarkHash1K 50000 38057 ns/op
    26.91 MB/s 128 B/op 2 allocs/op
    BenchmarkHash8K 10000 208131 ns/op
    39.36 MB/s 128 B/op 2 allocs/op
    BenchmarkHash8BytesUnaligned 200000 11457 ns/op
    0.70 MB/s 64 B/op 1 allocs/op
    BenchmarkHash1KUnaligned 50000 69334 ns/op
    14.77 MB/s 128 B/op 2 allocs/op
    BenchmarkHash8KUnaligned 5000 455120 ns/op
    18.00 MB/s 128 B/op 2 allocs/op

    After on Raspberry PI

    PASS
    BenchmarkHash8Bytes 500000 7091 ns/op
    1.13 MB/s +66% 0 B/op 0 allocs/op
    BenchmarkHash1K 100000 22469 ns/op
    45.57 MB/s +69% 0 B/op 0 allocs/op
    BenchmarkHash8K 10000 144155 ns/op
    56.83 MB/s +44% 0 B/op 0 allocs/op
    BenchmarkHash8BytesUnaligned 500000 7025 ns/op
    1.14 MB/s +62% 0 B/op 0 allocs/op
    BenchmarkHash1KUnaligned 100000 27727 ns/op
    36.93 MB/s +150% 0 B/op 0 allocs/op
    BenchmarkHash8KUnaligned 10000 185963 ns/op
    44.05 MB/s +140% 0 B/op 0 allocs/op

    This also adds another test which makes sure that the sums
    over larger blocks work properly. I wrote this test when I was
    worried about memory corruption.

    Please review this at https://codereview.appspot.com/11648043/

    Affected files:
    M src/pkg/crypto/md5/gen.go
    M src/pkg/crypto/md5/md5_test.go
    M src/pkg/crypto/md5/md5block.go
    A src/pkg/crypto/md5/md5block_arm.s
    M src/pkg/crypto/md5/md5block_decl.go


    --

    ---You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Nickcw at Jul 21, 2013 at 8:21 am

    On 2013/07/21 08:00:10, dfc wrote:
    Protip, misc/benchcmp before.txt after.txt
    I've updated the description with that - thanks!

    https://codereview.appspot.com/11648043/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dave Cheney at Jul 21, 2013 at 8:23 am
    No worries, I'm delighted to have more people enthusiastic to work on arm.


    On 21/07/2013, at 18:21, nickcw@gmail.com wrote:
    On 2013/07/21 08:00:10, dfc wrote:
    Protip, misc/benchcmp before.txt after.txt
    I've updated the description with that - thanks!

    https://codereview.appspot.com/11648043/
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Nick Craig-Wood at Jul 21, 2013 at 8:37 am

    On 21/07/13 09:23, Dave Cheney wrote:
    No worries, I'm delighted to have more people enthusiastic to work on arm.
    :-)

    In the past I wrote an enormous amount of ARM assembler (> 100k lines!)
    for Acorn RISC OS and various embedded platforms. It is great to be
    able to contribute to the ARM port as I've always enjoyed ARM assembler.

    When I saw that Go didn't have an ARM version of MD5 I remembered that I
    did one ages ago so I dug it out. In fact I ended up completely
    re-writing it because I didn't know about the alternative form of MD5
    then (with EORs instead of AND / OR).

    I've half written a document to summarize the learning process for how
    to write ARM code for Go. Is the go wiki is the right place for that?

    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedJul 21, '13 at 7:55a
activeJul 21, '13 at 8:37a
posts5
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase