francoispqt / gojay

high performance JSON encoder/decoder with stream API for Golang
MIT License
2.11k stars 112 forks source link

Update/switch to sync pool #24

Closed francoispqt closed 6 years ago

francoispqt commented 6 years ago

Sync pool appears to be much more performant than channels for memory pooling

codecov-io commented 6 years ago

Codecov Report

Merging #24 into master will decrease coverage by 0.32%. The diff coverage is 90.76%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #24      +/-   ##
=========================================
- Coverage   95.53%   95.2%   -0.33%     
=========================================
  Files          24      24              
  Lines        2171    2126      -45     
=========================================
- Hits         2074    2024      -50     
- Misses         65      70       +5     
  Partials       32      32
Impacted Files Coverage Δ
encode_stream.go 100% <100%> (ø) :arrow_up:
encode_pool.go 100% <100%> (ø) :arrow_up:
encode_stream_pool.go 100% <100%> (ø) :arrow_up:
decode_stream_pool.go 88.88% <81.25%> (-8.34%) :arrow_down:
decode_pool.go 90.9% <82.35%> (-9.1%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6614f5b...90b431e. Read the comment docs.

francoispqt commented 6 years ago

Changed pooling of encoders and decoders to use sync.Pool as performance is greatly impacted by channels.