Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

obfuscate: use strings.Builder from go1.10 #471

Merged
merged 2 commits into from
Sep 17, 2018
Merged

obfuscate: use strings.Builder from go1.10 #471

merged 2 commits into from
Sep 17, 2018

Conversation

gbbr
Copy link
Contributor

@gbbr gbbr commented Sep 17, 2018

This change updates JSON and Redis obfuscator to use strings.Builder
instead of bytes.Buffer for a minor speed increase. It also updates CI
to use go1.10, where this new structure was added.

Additionally, it also fixes a minor bug with an error message in the config
package.

@gbbr gbbr modified the milestones: next, 6.6.0 Sep 17, 2018
@gbbr
Copy link
Contributor Author

gbbr commented Sep 17, 2018

name                      old time/op    new time/op    delta
RedisObfuscator/445b-4      8.42µs ± 0%    6.48µs ± 0%  -23.06%
RedisQuantizer-4            1.27µs ± 0%    1.23µs ± 0%   -2.92%

name                      old alloc/op   new alloc/op   delta
RedisObfuscator/445b-4      9.68kB ± 0%    3.74kB ± 0%  -61.32%
RedisQuantizer-4            1.48kB ± 0%    1.37kB ± 0%   -7.32%

name                      old allocs/op  new allocs/op  delta
RedisObfuscator/445b-4         133 ± 0%        94 ± 0%  -29.32%
RedisQuantizer-4              12.0 ± 0%      11.0 ± 0%   -8.33%

Copy link
Member

@rochdev rochdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation still mentions Go 1.9+ as the minimum version for development.

This change updates JSON and Redis obfuscator to use `strings.Builder`
instead of `bytes.Buffer` for a minor speed increase. It also updates CI
to use go1.10, where this new structure was added.
@gbbr
Copy link
Contributor Author

gbbr commented Sep 17, 2018

@rochdev 👏 excellent! Done.

@gbbr gbbr merged commit 81ae02a into master Sep 17, 2018
@gbbr gbbr deleted the gbbr/go1.10 branch September 17, 2018 14:29
@gbbr gbbr removed the bug label Sep 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants