1
0
mirror of https://github.com/golang/go synced 2024-10-04 08:31:22 -06:00
Commit Graph

30 Commits

Author SHA1 Message Date
Nigel Tao
60ffae25bc hash/adler32: optimize.
The bulk of the gains come from hoisting the modulo ops outside of
the inner loop.

Reducing the digest type from 8 bytes to 4 bytes gains another 1% on
the hash/adler32 micro-benchmark.

Benchmarks for $GOOS,$GOARCH = linux,amd64 below.

hash/adler32 benchmark:
benchmark             old ns/op    new ns/op    delta
BenchmarkAdler32KB         1660         1364  -17.83%

image/png benchmark:
benchmark                       old ns/op    new ns/op    delta
BenchmarkDecodeGray               2466909      2425539   -1.68%
BenchmarkDecodeNRGBAGradient      9884500      9751705   -1.34%
BenchmarkDecodeNRGBAOpaque        8511615      8379800   -1.55%
BenchmarkDecodePaletted           1366683      1330677   -2.63%
BenchmarkDecodeRGB                6987496      6884974   -1.47%
BenchmarkEncodePaletted           6292408      6040052   -4.01%
BenchmarkEncodeRGBOpaque         19780680     19178440   -3.04%
BenchmarkEncodeRGBA              80738600     79076800   -2.06%

Wall time for Denis Cheremisov's PNG-decoding program given in
https://groups.google.com/group/golang-nuts/browse_thread/thread/22aa8a05040fdd49
Before: 2.44s
After:  2.26s
Delta:  -7%

R=rsc
CC=golang-dev
https://golang.org/cl/6251044
2012-05-25 09:58:38 +10:00
Pascal S. de Kloe
9feddd0bae hash: more efficient memory allocation
Feed append the complete content at once.

BenchmarkAdler32KB       1000000              2534 ns/op         404.05 MB/s
BenchmarkCrc32KB          500000              4757 ns/op         215.26 MB/s
BenchmarkCrc64KB          500000              4769 ns/op         214.70 MB/s
BenchmarkFnv32KB         1000000              2417 ns/op         423.64 MB/s
BenchmarkFnv32aKB        1000000              2408 ns/op         425.23 MB/s
BenchmarkFnv64KB          500000              4262 ns/op         240.21 MB/s
BenchmarkFnv64aKB         500000              4234 ns/op         241.83 MB/s

R=iant, rsc, r, minux.ma
CC=golang-dev
https://golang.org/cl/5937053
2012-04-10 15:15:39 -04:00
Russ Cox
2050a9e478 build: remove Make.pkg, Make.tool
Consequently, remove many package Makefiles,
and shorten the few that remain.

gomake becomes 'go tool make'.

Turn off test phases of run.bash that do not work,
flagged with $BROKEN.  Future CLs will restore these,
but this seemed like a big enough CL already.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
2012-01-30 23:43:46 -05:00
Luit van Drongelen
a5263c7caa crypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512
First was, apart from adding tests, a single line of code (to add the
constructor function). Adding SHA512-based hashing to crypto/hmac
required minor rework of the package because of a previously hardcoded
block-size in it's implementation. Instead of using a hash.Hash
generator function the constructor function now uses a crypto.Hash
type, which was extended to expose information about block size.

The only standard library package impacted by the change is
crypto/tls, for which the fix is included in this patch. It might be
useful to extend gofix to include this API change too.

R=agl, r, rsc, r
CC=golang-dev
https://golang.org/cl/5550043
2012-01-18 10:36:28 -05:00
Russ Cox
23cd406496 hash/crc32: make compatible with go/build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5486060
2011-12-14 10:25:16 -05:00
Andrew Gerrand
ca7d86c4d3 hash: rewrite comment on Hash.Sum method
Fixes #2530.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/5449101
2011-12-06 14:12:09 +11:00
Adam Langley
bac7bc55a6 Add a []byte argument to hash.Hash to allow an allocation to be saved.
This is the result of running `gofix -r hashsum` over the tree, changing
the hash function implementations by hand and then fixing a couple of
instances where gofix didn't catch something.

The changed implementations are as simple as possible while still
working: I'm not trying to optimise in this CL.

R=rsc, cw, rogpeppe
CC=golang-dev
https://golang.org/cl/5448065
2011-12-01 12:35:37 -05:00
Russ Cox
c2049d2dfe src/pkg/[a-m]*: gofix -r error -force=error
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5322051
2011-11-01 22:04:37 -04:00
Adam Langley
9f4c288c16 hash/crc32: add SSE4.2 support
Using the CRC32 instruction speeds up the Castagnoli computation by
about 20x on a modern Intel CPU.

R=rsc
CC=golang-dev
https://golang.org/cl/4650072
2011-07-12 09:29:24 -04:00
Russ Cox
cf9f380499 gc: unsafe.Alignof, unsafe.Offsetof, unsafe.Sizeof now return uintptr
R=ken2
CC=golang-dev
https://golang.org/cl/4640045
2011-06-17 16:12:14 -04:00
Brad Fitzpatrick
ba43be30c4 adler32: speed up ~40% by avoiding bounds checks
before & after:
adler32.BenchmarkGolden	  100000	     14747 ns/op
adler32.BenchmarkGolden	  200000	      8761 ns/op

Found by profiling PNG encoding.

R=rsc, bradfitzwork, eds
CC=golang-dev
https://golang.org/cl/4441073
2011-04-27 21:36:11 -07:00
Nigel Tao
6a186d38d1 src/pkg: make package doc comments consistently start with "Package foo".
R=rsc
CC=golang-dev
https://golang.org/cl/4442064
2011-04-20 09:57:05 +10:00
Robert Griesemer
a2e286828b gofmt: gofmt -s -w src misc
R=r, bradfitzwork
CC=golang-dev
https://golang.org/cl/4406044
2011-04-13 15:13:59 -07:00
Pascal S. de Kloe
4371e09457 hash: new FNV-1a implementation
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/4257042
2011-03-07 11:11:21 -05:00
Nigel Tao
ea70b0d51d hash/crc64: fix typo in Sum.
R=agl1
CC=golang-dev
https://golang.org/cl/3772043
2010-12-22 10:28:22 +11:00
Robert Griesemer
3478891d12 gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Russ Cox
da392d9136 build: no required environment variables
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Russ Cox
1a5cd2c0e1 hash/crc64: new package implementing 64-bit CRC
hash/crc32: add Update function
hash: add Sum64 interface

R=r
CC=golang-dev
https://golang.org/cl/445042
2010-03-12 17:38:18 -08:00
Russ Cox
b9f26c32c3 hash: document that Sum does not change hash state
crypto/*: implement and test proper Sum

Fixes #216.

R=agl1
CC=golang-dev
https://golang.org/cl/186210
2010-01-19 10:50:04 -08:00
Robert Griesemer
a3d1045fb7 1) Change default gofmt default settings for
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

3rd set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/180048
2009-12-15 15:35:38 -08:00
Trevor Strohman
f586870ec2 Add benchmarks for commonly used routines.
R=rsc, r, r1
https://golang.org/cl/160046
2009-11-24 00:21:50 -08:00
Sergio Luis O. B. Correia
6fc820729e go: makes it build for the case $GOROOT has whitespaces
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.

this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.

Fixes #115.

R=rsc, dsymonds1
https://golang.org/cl/157067
2009-11-23 17:32:51 -08:00
Russ Cox
364e564e3d use fully qualified names for hash interfaces
Fixes #38.

R=r1, r
https://golang.org/cl/152072
2009-11-11 12:00:15 -08:00
Robert Griesemer
3bb0032cd6 - replaced gofmt expression formatting algorithm with
rsc's algorithm
- applied gofmt -w misc src
- partial CL (last chunk)

R=rsc, r
http://go/go-review/1024041
2009-11-09 21:23:52 -08:00
Robert Griesemer
40621d5c0d remove semis after statements in one-statement statement lists
R=rsc, r
http://go/go-review/1025029
2009-11-09 12:07:39 -08:00
Robert Griesemer
368f8cbc75 - fine-tuning of one-line func heuristic (nodes.go)
- 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
2009-11-06 14:24:38 -08:00
Robert Griesemer
ca2a69ea06 gofmt-ify hash, http
(gofmt will be able to re-align map entries as in http nicely,
eventually)

R=rsc
http://go/go-review/1018055
2009-11-04 22:45:59 -08:00
Russ Cox
c2ec9583a0 apply gofmt to go, gob, hash, http, image, io, json, log
R=gri
DELTA=1359  (138 added, 32 deleted, 1189 changed)
OCL=35408
CL=35420
2009-10-06 19:41:51 -07:00
Russ Cox
b04ac108fd convert non-low-level non-google pkg code
to whole-package compilation.

R=r
OCL=33070
CL=33101
2009-08-12 13:19:17 -07:00
Rob Pike
d90e7cbac6 mv src/lib to src/pkg
tests: all.bash passes, gobuild still works, godoc still works.

R=rsc
OCL=30096
CL=30102
2009-06-09 09:53:44 -07:00