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

Issue 963044: code review 963044: big: use fast shift routines (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 2 months ago by gri
Modified:
15 years, 2 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

big: use fast shift routines - fixed a couple of bugs in the process (shift right was incorrect for negative numbers) - added more tests and made some tests more robust - changed pidigits back to using shifts to multiply by 2 instead of add This improves pidigit -s -n 10000 by approx. 5%: user 0m6.496s (old) user 0m6.156s (new)

Patch Set 1 #

Patch Set 2 : code review 963044: big: use fast shift routines #

Total comments: 2

Patch Set 3 : code review 963044: big: use fast shift routines #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -46 lines) Patch
M src/pkg/big/int.go View 2 chunks +16 lines, -15 lines 0 comments Download
M src/pkg/big/int_test.go View 2 chunks +7 lines, -1 line 0 comments Download
M src/pkg/big/nat.go View 5 chunks +53 lines, -9 lines 0 comments Download
M src/pkg/big/nat_test.go View 3 chunks +17 lines, -19 lines 0 comments Download
M test/bench/pidigits.go View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4
gri
Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change.
15 years, 2 months ago (2010-05-01 00:17:33 UTC) #1
rsc1
LGTM http://codereview.appspot.com/963044/diff/2001/3003 File src/pkg/big/nat.go (right): http://codereview.appspot.com/963044/diff/2001/3003#newcode557 src/pkg/big/nat.go:557: v.shiftLeftDeprecated(v, shift) ? http://codereview.appspot.com/963044/diff/2001/3003#newcode828 src/pkg/big/nat.go:828: // used directly ...
15 years, 2 months ago (2010-05-01 00:38:35 UTC) #2
gri
It is the overlap case. Since the result and the argument are the same in ...
15 years, 2 months ago (2010-05-01 02:57:11 UTC) #3
gri
15 years, 2 months ago (2010-05-01 04:25:56 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=f3b8969c33da ***

big: use fast shift routines

- fixed a couple of bugs in the process
  (shift right was incorrect for negative numbers)
- added more tests and made some tests more robust
- changed pidigits back to using shifts to multiply
  by 2 instead of add

  This improves pidigit -s -n 10000 by approx. 5%:

  user 0m6.496s (old)
  user 0m6.156s (new)

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

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