]> Cypherpunks repositories - gostls13.git/commit
encoding/gob: speedup floats encoding and decoding
authorAlberto Donizetti <alb.donizetti@gmail.com>
Sat, 18 Mar 2017 17:43:20 +0000 (18:43 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 18 Mar 2017 18:30:41 +0000 (18:30 +0000)
commit32cb0ce65b39fc91923ac12a0a94f34b5dfd04be
treead01b0da4ec6a3f521a9611a3c2006952d56a5aa
parentb6074a417dd707af3a9b39cc54769d7f8185961c
encoding/gob: speedup floats encoding and decoding

By replacing bytes-reversing routines with bits.ReverseBytes64 calls.

name                     old time/op  new time/op  delta
EncodeComplex128Slice-4  35.1µs ± 1%  23.2µs ± 2%  -33.94%  (p=0.000 n=20+20)
EncodeFloat64Slice-4     17.9µs ± 1%  11.0µs ± 1%  -38.36%  (p=0.000 n=17+18)

name                     old time/op  new time/op  delta
DecodeComplex128Slice-4  79.7µs ± 0%  69.9µs ± 1%  -12.31%  (p=0.000 n=20+20)
DecodeFloat64Slice-4     47.3µs ± 1%  42.2µs ± 1%  -10.65%  (p=0.000 n=17+17)

Change-Id: I91a6401c6009b5712fca6258dd1e57c6fe68ea64
Reviewed-on: https://go-review.googlesource.com/38352
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/encoding/gob/decode.go
src/encoding/gob/encode.go