1
0
mirror of https://github.com/golang/go synced 2024-10-05 00:21:21 -06:00
go/src/pkg
Adam Langley 133cdb6707 math/big: save some copies in binaryGCD.
This patch resulted from a bit of quick optimisation in response to a
golang-nuts post. It looks like one could save a couple other copies in
this function, but this addresses the inner loop and is fairly simple.

benchmark                    old ns/op    new ns/op    delta
BenchmarkGCD10x10                 1964         1711  -12.88%
BenchmarkGCD10x100                2019         1736  -14.02%
BenchmarkGCD10x1000               2471         2171  -12.14%
BenchmarkGCD10x10000              6040         5778   -4.34%
BenchmarkGCD10x100000            43204        43025   -0.41%
BenchmarkGCD100x100              11004         8520  -22.57%
BenchmarkGCD100x1000             11820         9446  -20.08%
BenchmarkGCD100x10000            23846        21382  -10.33%
BenchmarkGCD100x100000          133691       131505   -1.64%
BenchmarkGCD1000x1000           120041        95591  -20.37%
BenchmarkGCD1000x10000          136887       113600  -17.01%
BenchmarkGCD1000x100000         295370       273912   -7.26%
BenchmarkGCD10000x10000        2556126      2205198  -13.73%
BenchmarkGCD10000x100000       3159512      2808038  -11.12%
BenchmarkGCD100000x100000    150543094    139986045   -7.01%

R=gri, remyoudompheng
CC=bradfitz, gobot, golang-dev, gri
https://golang.org/cl/9424043
2013-05-15 10:03:22 -04:00
..
archive archive/tar: skip NUL-filled unused octal fields 2013-05-15 04:40:42 +08:00
bufio bufio.Scan: don't stop after Read returns 0, nil 2013-04-18 17:37:21 -07:00
builtin builtin: document true and false. 2013-04-18 14:36:08 -07:00
bytes runtime/bytes: fast Compare for byte arrays and strings. 2013-05-14 16:05:51 -07:00
compress compress/gzip: add Writer.Flush to call flate.Writer's Flush 2013-04-02 09:07:43 -07:00
container container/heap: fix int overflow bug 2013-03-04 10:25:21 -05:00
crypto crypto/rand: better panic message for invalid Int argument. 2013-04-17 23:21:15 -07:00
database/sql database/sql: use method values instead of generating closures 2013-05-14 16:35:31 -07:00
debug debug/elf: repair GNU version symbols. 2013-03-22 01:27:55 +01:00
encoding encoding/json: allocate less in NewEncoder 2013-05-14 15:50:46 -07:00
errors
expvar all: make tests able to run multiple times. 2013-01-27 00:24:09 +01:00
flag all: make tests able to run multiple times. 2013-01-27 00:24:09 +01:00
fmt fmt: fix crash for Printf("%.", 3) 2013-04-29 13:52:07 -07:00
go go/token: let FileSet.AddFile take a negative base 2013-05-14 09:30:13 -07:00
hash build: update assembly variable names for vet 2013-03-22 12:57:55 -04:00
html build: remove dead code 2013-03-22 17:28:22 -04:00
image image: minor update of comments. 2013-05-14 13:28:16 -07:00
index/suffixarray
io io: explain what (0,nil) means from Read 2013-04-18 17:36:25 -07:00
log log/syslog: fix race in test between channel close and accept. 2013-02-28 07:48:16 +01:00
math math/big: save some copies in binaryGCD. 2013-05-15 10:03:22 -04:00
mime mime/multipart: don't strip leading space/tab in quoted-printable decoding 2013-04-17 20:04:58 -07:00
net net/http: Fix basic authentication with empty password 2013-05-14 15:33:46 -07:00
os os/user: faster user lookup on Windows 2013-05-15 13:24:54 +10:00
path all: Skip AllocsPerRun tests if GOMAXPROCS>1. 2013-03-06 15:52:32 -08:00
reflect reflect: document the unreliability of StringHeader and SliceHeader 2013-04-07 18:42:47 -07:00
regexp regexp: doc fix 2013-05-02 18:59:39 -07:00
runtime runtime: unset m->locks after actual lock unlock 2013-05-15 16:48:41 +04:00
sort sort: don't depend on math 2013-04-20 17:20:41 -07:00
strconv strconv: remove some test TODOs and adjust malloc limits lower 2013-04-04 17:04:18 -07:00
strings bytes,strings: remove user name from BUG in comment 2013-03-19 15:04:18 -07:00
sync sync, sync/atomic: do not corrupt race detector after a nil dereference. 2013-04-08 23:46:54 +02:00
syscall os/user: faster user lookup on Windows 2013-05-15 13:24:54 +10:00
testing testing/quick: fix for aliased types, delete duplicate uint8 test, and fix randFloat64() to give random numbers from (-math.MaxFloat64, math.MaxFloat64). 2013-05-14 17:14:59 -07:00
text text/template: comment fix 2013-05-03 14:22:34 -07:00
time time: stop 1ns timer in test 2013-04-26 11:08:50 +04:00
unicode unicode: modify a comment to the convention format. 2013-03-19 14:47:41 -04:00
unsafe unsafe: fix a typo 2012-10-19 16:35:15 +11:00