1
0
mirror of https://github.com/golang/go synced 2024-10-05 19:21:21 -06:00
go/src/expvar
Matt T. Proud 926616da3f expvar: swap Float sync. from mutex to atomic.
Float type from a mutex to atomic bit array in a manner akin to
Google Guava's AtomicDouble[0], including adding a benchmark for the
type (benchcmp included below) along with some expvar_test.go cruft
being fixed.

benchmark             old ns/op     new ns/op     delta
BenchmarkFloatSet     115           9.37          -91.85%
BenchmarkFloatAdd     114           17.1          -85.00%

benchmark             old allocs     new allocs     delta
BenchmarkFloatSet     0              0              +0.00%
BenchmarkFloatAdd     0              0              +0.00%

benchmark             old bytes     new bytes     delta
BenchmarkFloatSet     0             0             +0.00%
BenchmarkFloatAdd     0             0             +0.00%

[0] - http://goo.gl/m4dtlI

Change-Id: I4ce6a913734ec692e3ed243f6e6f7c11da4c6036
Reviewed-on: https://go-review.googlesource.com/3687
Reviewed-by: Rob Pike <r@golang.org>
2015-04-12 23:07:50 +00:00
..
expvar_test.go expvar: swap Float sync. from mutex to atomic. 2015-04-12 23:07:50 +00:00
expvar.go expvar: swap Float sync. from mutex to atomic. 2015-04-12 23:07:50 +00:00