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

Issue 4527089: code review 4527089: big: ~8x faster number scanning (Closed)

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

Description

big: ~8x faster number scanning - better number scanning algorithm - fixed a couple of bugs related to base interpretation - added scan benchmark - added more test cases and made tests more precise - introduced Int.scan method matching nat.scan - refactored Int.Scan; now uses int.scan - refactored Int.SetString; now uses int.scan There is more potential, this was a fairly simple change. gotest -test.bench="ScanPi" before/after (best of 3 runs): big.BenchmarkScanPi 1000 2024900 ns/op big.BenchmarkScanPi 10000 257540 ns/op

Patch Set 1 #

Patch Set 2 : diff -r aa3072daee08 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r aa3072daee08 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r aa3072daee08 https://go.googlecode.com/hg/ #

Total comments: 4

Patch Set 5 : diff -r 334b588b4e4f https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 334b588b4e4f https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 7 : diff -r 334b588b4e4f https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r 2e0aa4ab6d9f https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+247 lines, -105 lines) Patch
M src/pkg/big/int.go View 1 2 3 4 5 6 4 chunks +53 lines, -48 lines 0 comments Download
M src/pkg/big/nat.go View 1 2 3 4 5 2 chunks +65 lines, -42 lines 0 comments Download
M src/pkg/big/nat_test.go View 1 2 3 4 3 chunks +129 lines, -15 lines 0 comments Download

Messages

Total messages: 7
gri
Hello chickencha@gmail.com (cc: golang-dev@googlegroups.com, rsc@golang.org), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 11 months ago (2011-06-01 00:52:22 UTC) #1
eds
Nice, LGTM. A couple suggestions. http://codereview.appspot.com/4527089/diff/8001/src/pkg/big/int.go File src/pkg/big/int.go (right): http://codereview.appspot.com/4527089/diff/8001/src/pkg/big/int.go#newcode465 src/pkg/big/int.go:465: func (z *Int) SetString(s ...
13 years, 11 months ago (2011-06-01 01:33:40 UTC) #2
gri
PTAL. Also fixed a couple of bugs related to the returned base in special cases, ...
13 years, 11 months ago (2011-06-01 18:19:05 UTC) #3
eds
http://codereview.appspot.com/4527089/diff/12002/src/pkg/big/int.go File src/pkg/big/int.go (right): http://codereview.appspot.com/4527089/diff/12002/src/pkg/big/int.go#newcode457 src/pkg/big/int.go:457: // SetString sets z to the value of s, ...
13 years, 11 months ago (2011-06-01 21:02:23 UTC) #4
gri
PTAL. http://codereview.appspot.com/4527089/diff/12002/src/pkg/big/int.go File src/pkg/big/int.go (right): http://codereview.appspot.com/4527089/diff/12002/src/pkg/big/int.go#newcode457 src/pkg/big/int.go:457: // SetString sets z to the value of ...
13 years, 11 months ago (2011-06-01 21:05:18 UTC) #5
eds
LGTM
13 years, 11 months ago (2011-06-01 21:07:45 UTC) #6
gri
13 years, 11 months ago (2011-06-01 21:17:06 UTC) #7
*** Submitted as http://code.google.com/p/go/source/detail?r=73d526d94d1d ***

big: ~8x faster number scanning

- better number scanning algorithm
- fixed a couple of bugs related to base interpretation
- added scan benchmark
- added more test cases and made tests more precise
- introduced Int.scan method matching nat.scan
- refactored Int.Scan; now uses int.scan
- refactored Int.SetString; now uses int.scan

There is more potential, this was a fairly simple change.

gotest -test.bench="ScanPi" before/after (best of 3 runs):
big.BenchmarkScanPi	   1000	    2024900 ns/op
big.BenchmarkScanPi       10000      257540 ns/op

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

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