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

Issue 10524044: code review 10524044: crypto/sha1: remove an allocation in Sum (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by r
Modified:
10 years, 10 months ago
Reviewers:
golang-dev, dave, iant, bradfitz
Visibility:
Public.

Description

crypto/sha1: remove an allocation in Sum sha1.Sum does two allocations; this CL removes one of them by placing a small array in the digest that it can use as a temporary, and by moving the large constant padding array to a global.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -6 lines) Patch
M src/pkg/crypto/sha1/sha1.go View 2 chunks +10 lines, -6 lines 0 comments Download

Messages

Total messages: 12
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
10 years, 10 months ago (2013-06-24 23:03:13 UTC) #1
iant
LGTM
10 years, 10 months ago (2013-06-24 23:40:24 UTC) #2
bradfitz
What causes var tmp [64]byte to escape? It's only passed to (*digest).Write, a concrete type, ...
10 years, 10 months ago (2013-06-24 23:40:58 UTC) #3
r
I tried that without success, although I may have done it wrong. -rob
10 years, 10 months ago (2013-06-24 23:53:05 UTC) #4
r
Like this: //go:noescape func block(dig *digest, p []byte)
10 years, 10 months ago (2013-06-24 23:54:46 UTC) #5
bradfitz
I was also just trying. I looked at at a diff of go build -gcflags ...
10 years, 10 months ago (2013-06-24 23:56:18 UTC) #6
r
I just did the same experiment with cshapiro watching. Here's what I have: go build ...
10 years, 10 months ago (2013-06-25 00:20:49 UTC) #7
r
Ha, it's a bug. If you compile sha1block_decl.go BEFORE sha1.go, it all works. So the ...
10 years, 10 months ago (2013-06-25 00:24:03 UTC) #8
r
*** Abandoned ***
10 years, 10 months ago (2013-06-25 00:24:25 UTC) #9
dave_cheney.net
What a wonderful bug! A workaround would be to create a placeholder sha1block_arm.s file, then ...
10 years, 10 months ago (2013-06-25 00:27:15 UTC) #10
r
Issue 5773
10 years, 10 months ago (2013-06-25 00:28:23 UTC) #11
bradfitz
10 years, 10 months ago (2013-06-25 00:30:40 UTC) #12
Nice. You saved me some debugging time trying to come up with a minimal
repro. I probably wouldn't have guessed that too soon.  :-)



On Mon, Jun 24, 2013 at 5:28 PM, Rob Pike <r@golang.org> wrote:

> Issue 5773
>
Sign in to reply to this message.

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