Closed AsterDY closed 7 months ago
Attention: 150 lines
in your changes are missing coverage. Please review.
Comparison is base (
8c71eb0
) 78.57% compared to head (80578e5
) 77.62%.
Files | Patch % | Lines |
---|---|---|
internal/decoder/debug.go | 0.00% | 108 Missing :warning: |
internal/decoder/generic_regabi_amd64.go | 25.00% | 38 Missing and 4 partials :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Background
growslice
+makemap
+rehash
) during deserializing.Draft
there are two methods:
count_elems
:skip_one_fast
for every elements in object/array, and count them -- the result is accurate as well as consuming a lot of CPUcount_elems_fast
:skip_one_fast
only for the entire container to obtain start and end, then scan and count number of comma,
-- the result is inaccurate but very fastbelow is benchmark result: (1~100 elements in a array)
It seems only the
count_elems_fast
method is worthy for trading off container growth overheadExperiment
use
count_elems_fast()
native func to scan and predict element size.name old allocs/op new allocs/op delta PredictContSize/map/N=0-16 2.00 ± 0% 2.00 ± 0% ~ (all equal) PredictContSize/map/N=1-16 3.00 ± 0% 3.00 ± 0% ~ (all equal) PredictContSize/map/N=10-16 4.00 ± 0% 3.00 ± 0% -25.00% (p=0.000 n=10+10) PredictContSize/map/N=100-16 10.0 ± 0% 4.0 ± 0% -60.00% (p=0.000 n=10+10) PredictContSize/map/N=1000-16 42.5 ± 1% 4.0 ± 0% -90.59% (p=0.000 n=10+10) PredictContSize/slice/N=0-16 1.00 ± 0% 1.00 ± 0% ~ (all equal) PredictContSize/slice/N=1-16 2.00 ± 0% 2.00 ± 0% ~ (all equal) PredictContSize/slice/N=10-16 4.00 ± 0% 2.00 ± 0% -50.00% (p=0.000 n=10+10) PredictContSize/slice/N=100-16 6.00 ± 0% 2.00 ± 0% -66.67% (p=0.000 n=10+10) PredictContSize/slice/N=1000-16 8.00 ± 0% 2.00 ± 0% -75.00% (p=0.000 n=10+10)
name old time/op new time/op delta Generic_DecodeGeneric-16 81.3µs ± 0% 67.7µs ± 8% -16.81% (p=0.000 n=6+9) Generic_Parallel_DecodeGeneric-16 25.6µs ±19% 29.1µs ±26% ~ (p=0.063 n=10+10)
name old speed new speed delta Generic_DecodeGeneric-16 160MB/s ± 0% 193MB/s ± 7% +20.33% (p=0.000 n=6+9) Generic_Parallel_DecodeGeneric-16 515MB/s ±21% 459MB/s ±32% ~ (p=0.063 n=10+10)
name old alloc/op new alloc/op delta Generic_DecodeGeneric-16 48.9kB ± 0% 67.8kB ± 0% +38.49% (p=0.000 n=8+10) Generic_Parallel_DecodeGeneric-16 49.0kB ± 0% 67.9kB ± 0% +38.50% (p=0.000 n=10+10)
name old allocs/op new allocs/op delta Generic_DecodeGeneric-16 313 ± 0% 291 ± 0% -7.03% (p=0.000 n=10+10)