Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
R=gri
CC=golang-dev
http://codereview.appspot.com/1372042
|
|
ModInverse is just a small wrapper around GcdInt, but it's nice to
have in order to be clear about what one is doing in other code.
R=gri, agl1
CC=golang-dev
http://codereview.appspot.com/1244045
|
|
R=gri
CC=golang-dev, golang-dev
http://codereview.appspot.com/1244044
|
|
always return z for nat.scan
R=rsc
CC=golang-dev
http://codereview.appspot.com/1236043
|
|
forthcoming implementation of big.Rat)
R=rsc
CC=golang-dev
http://codereview.appspot.com/1229047
Committer: Robert Griesemer <gri@golang.org>
|
|
- support for binary prefix 0b (to match fmt.Format)
- renamed nat.new -> nat.setUint64 for consistency
- more tests
R=r
CC=golang-dev
http://codereview.appspot.com/1233041
Committer: Robert Griesemer <gri@golang.org>
|
|
- pass []Word instead of *Word to core arithmetic functions
- remove dead code
R=rsc
CC=golang-dev
http://codereview.appspot.com/1154042
|
|
- no need to make copies in cases of aliases
- removed deprecated internal shift functions
- minor unrelated simplifications
This change improves pidigits -s -n10000 by almost 20%:
user 0m6.156s (old)
user 0m4.999s (new)
(pidigits -s -n20000 goes from ~25s to ~19s)
R=rsc
CC=golang-dev
http://codereview.appspot.com/1149041
|
|
- renamed Len -> BitLen, simplified implementation
- renamed old Div, Mod, DivMod -> Que, Rem, QuoRem
- implemented Div, Mod, DivMod (Euclidian definition, more
useful in a mathematical context)
- fixed a bug in Exp (-0 was possible)
- added extra tests to check normalized results everywhere
- uniformly set Int.neg flag at the end of computations
- minor cosmetic cleanups
- ran all tests
R=rsc
CC=golang-dev
http://codereview.appspot.com/1091041
|
|
R=gri
CC=golang-dev
http://codereview.appspot.com/987041
Committer: Robert Griesemer <gri@golang.org>
|
|
- 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
|
|
Plus:
- calibration "test" - include in tests with gotest -calibrate
- basic Mul benchmark
- extra multiplication tests
- various cleanups
This change improves multiplication speed of numbers >= 30 words
in length (current threshold; found empirically with calibrate):
The multiplication benchmark (multiplication of a variety of long numbers)
improves by ~35%, individual multiplies can be significantly faster.
gotest -benchmarks=Mul
big.BenchmarkMul 500 6829290 ns/op (w/ Karatsuba)
big.BenchmarkMul 100 10600760 ns/op
There's no impact on pidigits for -n=10000 or -n=20000
because the operands are are too small.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1004042
Committer: Robert Griesemer <gri@golang.org>
|
|
Changed most of the functions in nat.go to methods on nat.
R=gri
CC=golang-dev
http://codereview.appspot.com/976041
Committer: Robert Griesemer <gri@golang.org>
|
|
This yields a pretty significant performance boost to pidigits and there are still some improvements to be made. Here are my numbers:
amd64 w/ bignum:
pidigits 10000
gcc -O2 pidigits.c -lgmp 2.10u 0.00s 2.10r
gc pidigits 22.92u 0.02s 22.97r
gc_B pidigits 22.62u 0.00s 22.65r
amd64 w/ big:
pidigits 10000
gcc -O2 pidigits.c -lgmp 2.09u 0.02s 2.11r
gc pidigits 12.68u 0.04s 12.72r
gc_B pidigits 12.71u 0.03s 12.75r
386 w/ bignum:
pidigits 10000
gcc -O2 pidigits.c -lgmp 2.09u 0.00s 2.09r
gc pidigits 44.30u 0.01s 44.35r
gc_B pidigits 44.29u 0.03s 44.35r
386 w/ big:
pidigits 10000
gcc -O2 pidigits.c -lgmp 2.10u 0.00s 2.10r
gc pidigits 22.70u 0.06s 22.79r
gc_B pidigits 22.80u 0.09s 22.91r
R=rsc, gri
CC=golang-dev
http://codereview.appspot.com/881050
Committer: Russ Cox <rsc@golang.org>
|
|
Fixes issue 698.
Fixes issue 699.
R=rsc
CC=golang-dev
http://codereview.appspot.com/824041
|
|
(changes adopted from alc, agl)
R=agl1, agl
CC=golang-dev
http://codereview.appspot.com/181137
|
|
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
1st set of files.
R=rsc
CC=agl, golang-dev, iant, ken2, r
http://codereview.appspot.com/180047
|
|
R=r, gri
CC=golang-dev
http://codereview.appspot.com/156115
|
|
|
|
TBR=agl1
CC=golang-dev
http://codereview.appspot.com/154065
|
|
Turn methods that don't store the result in their receiver into
functions in order to preserve the convention.
Re-jig Exp and Div by moving their guts into nat.go.
Add ProbablyPrime to perform Miller-Rabin primality tests.
crypto/rsa: reenable key generation since we now have ProbablyPrime.
R=gri
CC=go-dev
http://codereview.prom.corp.google.com/1024038
|
|
rsc's algorithm
- applied gofmt -w misc src
- partial CL (remaining files in other CLs)
R=rsc, r
http://go/go-review/1024040
|
|
R=rsc, r
http://go/go-review/1025029
|
|
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)
R=r, rsc
CC=go-dev
http://go/go-review/1026006
|
|
R=gri, rsc
CC=go-dev
http://go/go-review/1017036
|
|
that have not changed since I applied gofmt.
R=gri
DELTA=456 (77 added, 3 deleted, 376 changed)
OCL=35378
CL=35383
|
|
- changed Cmp to return -1, 0, +1
- added corresponding test cases
R=rsc
DELTA=173 (136 added, 3 deleted, 34 changed)
OCL=33431
CL=33459
|
|
- no other changes
R=r
DELTA=1248 (623 added, 623 deleted, 2 changed)
OCL=33371
CL=33371
|