You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
results: Faster JSON encoding and decoding (#506)
* Add .idea to .gitignore
* results: Faster JSON encoding and decoding
This commit improves the performance of JSON encoding and decoding of
`Results`. Additionally, it fixes a regression introduced in #474 that
didn't produce valid JSON for HTTP headers. A test is added that
validates the JSON encoding matches the one produced by the
`encoding/json`.
```
name old time/op new time/op delta
ResultEncodings/json-encode-16 690ns ±12% 297ns ± 0% -56.94%
(p=0.000 n=9+9)
ResultEncodings/json-decode-16 1.05µs ± 1% 0.03µs ± 1% -97.47%
(p=0.000 n=10+8)
name old alloc/op new alloc/op delta
ResultEncodings/json-encode-16 804B ±87% 0B -100.00%
(p=0.000 n=9+10)
ResultEncodings/json-decode-16 310B ± 0% 0B -100.00%
(p=0.000 n=10+10)
name old allocs/op new allocs/op delta
ResultEncodings/json-encode-16 4.00 ± 0% 0.00 -100.00%
(p=0.000 n=10+10)
ResultEncodings/json-decode-16 4.00 ± 0% 0.00 -100.00%
(p=0.000 n=10+10)
```