1
0
mirror of https://github.com/json-iterator/go.git synced 2025-04-20 11:28:49 +02:00

2 Commits

Author SHA1 Message Date
Rob Figueiredo
91f4a6405d (*Stream).Flush: reset buffer to beginning
Previously it would append to the end of the buffer instead of reusing the
now-free space.

Benchmark demonstrates the improvement, run with -benchtime=10s

    benchmark                                        old ns/op     new ns/op     delta
    Benchmark_encode_string_with_SetEscapeHTML-8     447           442           -1.12%
    Benchmark_jsoniter_large_file-8                  20998         21222         +1.07%
    Benchmark_json_large_file-8                      39593         40187         +1.50%
    Benchmark_stream_encode_big_object-8             10787         8611          -20.17%

    benchmark                                        old allocs     new allocs     delta
    Benchmark_encode_string_with_SetEscapeHTML-8     6              6              +0.00%
    Benchmark_jsoniter_large_file-8                  78             78             +0.00%
    Benchmark_json_large_file-8                      13             13             +0.00%
    Benchmark_stream_encode_big_object-8             31             0              -100.00%

    benchmark                                        old bytes     new bytes     delta
    Benchmark_encode_string_with_SetEscapeHTML-8     760           760           +0.00%
    Benchmark_jsoniter_large_file-8                  4920          4920          +0.00%
    Benchmark_json_large_file-8                      6640          6640          +0.00%
    Benchmark_stream_encode_big_object-8             10056         0             -100.00%

Fixes #438
2020-01-17 21:57:59 -05:00
Tao Wen
3d39af6dd9 remove feature prefix 2018-02-19 23:04:25 +08:00