Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bytedance/sonic to benchmark target #254

Merged
merged 2 commits into from Jun 23, 2021
Merged

Conversation

goccy
Copy link
Owner

@goccy goccy commented Jun 21, 2021

Benchmark Results

$ cd benchmarks
$ go test -bench .

Encode

Benchmark_Encode_SmallStruct_EncodingJson-16                     1758979               638 ns/op             256 B/op          2 allocs/op
Benchmark_Encode_SmallStruct_FFJson-16                           1296138               918 ns/op             584 B/op          9 allocs/op
Benchmark_Encode_SmallStruct_JsonIter-16                         2021334               590 ns/op             264 B/op          3 allocs/op
Benchmark_Encode_SmallStruct_EasyJson-16                         2028477               587 ns/op             720 B/op          4 allocs/op
Benchmark_Encode_SmallStruct_Jettison-16                         2538632               466 ns/op             256 B/op          2 allocs/op
Benchmark_Encode_SmallStruct_GoJay-16                            2580408               467 ns/op             624 B/op          2 allocs/op
Benchmark_Encode_SmallStruct_SegmentioJson-16                    3804675               306 ns/op             256 B/op          2 allocs/op
Benchmark_Encode_SmallStruct_Sonic-16                            3440547               340 ns/op             421 B/op          5 allocs/op
Benchmark_Encode_SmallStruct_GoJsonColored-16                    2506153               479 ns/op             432 B/op          2 allocs/op
Benchmark_Encode_SmallStruct_GoJson-16                           3893574               301 ns/op             256 B/op          2 allocs/op
Benchmark_Encode_SmallStruct_GoJsonNoEscape-16                   5325240               222 ns/op             144 B/op          1 allocs/op
Benchmark_Encode_SmallStructCached_EncodingJson-16               2322298               511 ns/op             144 B/op          1 allocs/op
Benchmark_Encode_SmallStructCached_FFJson-16                     1364814               876 ns/op             472 B/op          8 allocs/op
Benchmark_Encode_SmallStructCached_JsonIter-16                   2157280               531 ns/op             152 B/op          2 allocs/op
Benchmark_Encode_SmallStructCached_EasyJson-16                   2049332               588 ns/op             720 B/op          4 allocs/op
Benchmark_Encode_SmallStructCached_Jettison-16                   3014660               401 ns/op             144 B/op          1 allocs/op
Benchmark_Encode_SmallStructCached_GoJay-16                      2974846               394 ns/op             512 B/op          1 allocs/op
Benchmark_Encode_SmallStructCached_SegmentioJson-16              4925233               238 ns/op             144 B/op          1 allocs/op
Benchmark_Encode_SmallStructCached_Sonic-16                      4196659               282 ns/op             285 B/op          4 allocs/op
Benchmark_Encode_SmallStructCached_GoJsonColored-16              2878724               404 ns/op             320 B/op          1 allocs/op
Benchmark_Encode_SmallStructCached_GoJson-16                     5268955               221 ns/op             144 B/op          1 allocs/op
Benchmark_Encode_SmallStructCached_GoJsonNoEscape-16             5515668               218 ns/op             144 B/op          1 allocs/op
Benchmark_Encode_MediumStruct_EncodingJson-16                     761329              1615 ns/op             632 B/op         15 allocs/op
Benchmark_Encode_MediumStruct_JsonIter-16                         810834              1459 ns/op             640 B/op         16 allocs/op
Benchmark_Encode_MediumStruct_EasyJson-16                        1224240               920 ns/op             896 B/op          4 allocs/op
Benchmark_Encode_MediumStruct_Jettison-16                         865650              1439 ns/op             633 B/op         15 allocs/op
Benchmark_Encode_MediumStruct_GoJay-16                           1000000              1127 ns/op             824 B/op         15 allocs/op
Benchmark_Encode_MediumStruct_SegmentioJson-16                   1000000              1077 ns/op             633 B/op         15 allocs/op
Benchmark_Encode_MediumStruct_Sonic-16                           1299313               918 ns/op             919 B/op         18 allocs/op
Benchmark_Encode_MediumStruct_GoJsonColored-16                    955344              1276 ns/op             888 B/op         15 allocs/op
Benchmark_Encode_MediumStruct_GoJson-16                          1228599               987 ns/op             632 B/op         15 allocs/op
Benchmark_Encode_MediumStruct_GoJsonNoEscape-16                  2143932               557 ns/op             320 B/op          1 allocs/op
Benchmark_Encode_MediumStructCached_EncodingJson-16              1000000              1160 ns/op             320 B/op          1 allocs/op
Benchmark_Encode_MediumStructCached_JsonIter-16                  1000000              1037 ns/op             328 B/op          2 allocs/op
Benchmark_Encode_MediumStructCached_EasyJson-16                  1322378               926 ns/op             896 B/op          4 allocs/op
Benchmark_Encode_MediumStructCached_Jettison-16                  1243608               965 ns/op             320 B/op          1 allocs/op
Benchmark_Encode_MediumStructCached_GoJay-16                     1596103               736 ns/op             512 B/op          1 allocs/op
Benchmark_Encode_MediumStructCached_SegmentioJson-16             1795857               665 ns/op             320 B/op          1 allocs/op
Benchmark_Encode_MediumStructCached_Sonic-16                     2240252               525 ns/op             505 B/op          4 allocs/op
Benchmark_Encode_MediumStructCached_GoJsonColored-16             1475028               811 ns/op             576 B/op          1 allocs/op
Benchmark_Encode_MediumStructCached_GoJson-16                    2167310               549 ns/op             320 B/op          1 allocs/op
Benchmark_Encode_MediumStructCached_GoJsonNoEscape-16            2205925               544 ns/op             320 B/op          1 allocs/op
Benchmark_Encode_LargeStruct_EncodingJson-16                       41130             28986 ns/op           14689 B/op        319 allocs/op
Benchmark_Encode_LargeStruct_JsonIter-16                           43362             27180 ns/op           14704 B/op        320 allocs/op
Benchmark_Encode_LargeStruct_EasyJson-16                           52581             22670 ns/op           15368 B/op        326 allocs/op
Benchmark_Encode_LargeStruct_Jettison-16                           47400             24705 ns/op           14648 B/op        319 allocs/op
Benchmark_Encode_LargeStruct_GoJay-16                              44248             26955 ns/op           28048 B/op        323 allocs/op
Benchmark_Encode_LargeStruct_SegmentioJson-16                      55810             20904 ns/op           14654 B/op        319 allocs/op
Benchmark_Encode_LargeStruct_Sonic-16                              59978             18874 ns/op           19377 B/op        322 allocs/op
Benchmark_Encode_LargeStruct_GoJsonColored-16                      45266             26126 ns/op           20982 B/op        319 allocs/op
Benchmark_Encode_LargeStruct_GoJson-16                             60453             19527 ns/op           14713 B/op        319 allocs/op
Benchmark_Encode_LargeStruct_GoJsonNoEscape-16                     61194             19702 ns/op           14709 B/op        319 allocs/op
Benchmark_Encode_LargeStructCached_EncodingJson-16                 69552             16828 ns/op            4866 B/op          1 allocs/op
Benchmark_Encode_LargeStructCached_JsonIter-16                     78831             14926 ns/op            4874 B/op          2 allocs/op
Benchmark_Encode_LargeStructCached_EasyJson-16                    107347             10497 ns/op            5591 B/op          8 allocs/op
Benchmark_Encode_LargeStructCached_Jettison-16                     99374             11633 ns/op            4866 B/op          1 allocs/op
Benchmark_Encode_LargeStructCached_GoJay-16                        83335             14057 ns/op           18310 B/op          5 allocs/op
Benchmark_Encode_LargeStructCached_SegmentioJson-16               128884              9030 ns/op            4866 B/op          1 allocs/op
Benchmark_Encode_LargeStructCached_Sonic-16                       163424              6504 ns/op            6073 B/op          4 allocs/op
Benchmark_Encode_LargeStructCached_GoJsonColored-16                85876             13851 ns/op           10893 B/op          1 allocs/op
Benchmark_Encode_LargeStructCached_GoJson-16                      159201              7241 ns/op            4867 B/op          1 allocs/op
Benchmark_Encode_LargeStructCached_GoJsonNoEscape-16              152703              7629 ns/op            4866 B/op          1 allocs/op

Decode

Benchmark_Decode_SmallStruct_Unmarshal_EncodingJson-16                            495511              2465 ns/op             400 B/op         10 allocs/op
Benchmark_Decode_SmallStruct_Unmarshal_FastJson-16                                655467              1877 ns/op            3376 B/op         11 allocs/op
Benchmark_Decode_SmallStruct_Unmarshal_SegmentioJson-16                          1000000              1044 ns/op             192 B/op          5 allocs/op
Benchmark_Decode_SmallStruct_Unmarshal_Sonic-16                                  1313098               884 ns/op             318 B/op          2 allocs/op
Benchmark_Decode_SmallStruct_Unmarshal_JsonIter-16                               1487892               790 ns/op             208 B/op         13 allocs/op
Benchmark_Decode_SmallStruct_Unmarshal_GoJay-16                                  2625217               461 ns/op             256 B/op          2 allocs/op
Benchmark_Decode_SmallStruct_Unmarshal_GoJayUnsafe-16                            2990905               403 ns/op             112 B/op          1 allocs/op
Benchmark_Decode_SmallStruct_Unmarshal_GoJson-16                                 2861204               427 ns/op             256 B/op          2 allocs/op
Benchmark_Decode_SmallStruct_Unmarshal_GoJsonNoEscape-16                         3269599               368 ns/op             144 B/op          1 allocs/op
Benchmark_Decode_SmallStruct_Stream_EncodingJson-16                               374606              2881 ns/op            1104 B/op         12 allocs/op
Benchmark_Decode_SmallStruct_Stream_SegmentioJson-16                              195001              6013 ns/op           32960 B/op          6 allocs/op
Benchmark_Decode_SmallStruct_Stream_JsonIter-16                                  1000000              1035 ns/op             872 B/op         16 allocs/op
Benchmark_Decode_SmallStruct_Stream_GoJay-16                                     1974406               598 ns/op             720 B/op          3 allocs/op
Benchmark_Decode_SmallStruct_Stream_GoJson-16                                    1736973               701 ns/op             752 B/op          4 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_EncodingJson-16                            77605             15261 ns/op             696 B/op         19 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_FastJson-16                               109099             11148 ns/op           17304 B/op         54 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_Sonic-16                                  199030              5538 ns/op            2949 B/op         10 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_SegmentioJson-16                          221757              5452 ns/op             296 B/op          9 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_JsonIter-16                               206128              5641 ns/op             792 B/op         82 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_GoJay-16                                  356571              3285 ns/op            2449 B/op          8 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_GoJayUnsafe-16                            413600              2655 ns/op             144 B/op          7 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_GoJson-16                                 380134              3054 ns/op            2450 B/op          8 allocs/op
Benchmark_Decode_MediumStruct_Unmarshal_GoJsonNoEscape-16                         378936              3012 ns/op            2417 B/op          7 allocs/op
Benchmark_Decode_MediumStruct_Stream_EncodingJson-16                               66907             17788 ns/op            7136 B/op         26 allocs/op
Benchmark_Decode_MediumStruct_Stream_SegmentioJson-16                              79255             14978 ns/op           33064 B/op         10 allocs/op
Benchmark_Decode_MediumStruct_Stream_JsonIter-16                                  180520              6185 ns/op            1792 B/op         91 allocs/op
Benchmark_Decode_MediumStruct_Stream_GoJay-16                                     252622              4578 ns/op            7920 B/op         12 allocs/op
Benchmark_Decode_MediumStruct_Stream_GoJson-16                                    274725              4117 ns/op            3857 B/op         12 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_EncodingJson-16                              6193            192825 ns/op            6240 B/op        191 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_FastJson-16                                  8415            136396 ns/op          283203 B/op        540 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_Sonic-16                                    12828             93817 ns/op           33703 B/op         69 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_SegmentioJson-16                            12909             93664 ns/op            4400 B/op        132 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_JsonIter-16                                 12469            100365 ns/op           17175 B/op       1271 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_GoJay-16                                    30656             39702 ns/op           31243 B/op         77 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_GoJayUnsafe-16                              38924             31461 ns/op            2561 B/op         76 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_GoJson-16                                   25117             44780 ns/op           30764 B/op         67 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_GoJsonNoEscape-16                           27336             44909 ns/op           30732 B/op         66 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_GoJsonFirstWinMode-16                       30105             38278 ns/op           30764 B/op         67 allocs/op
Benchmark_Decode_LargeStruct_Unmarshal_GoJsonNoEscapeFirstWinMode-16               31774             39654 ns/op           30732 B/op         66 allocs/op
Benchmark_Decode_LargeStruct_Stream_EncodingJson-16                                 5036            232671 ns/op           70016 B/op        201 allocs/op
Benchmark_Decode_LargeStruct_Stream_SegmentioJson-16                                7902            154695 ns/op           37168 B/op        133 allocs/op
Benchmark_Decode_LargeStruct_Stream_JsonIter-16                                    10000            118541 ns/op           21320 B/op       1398 allocs/op
Benchmark_Decode_LargeStruct_Stream_GoJay-16                                       25486             47258 ns/op           67680 B/op         84 allocs/op
Benchmark_Decode_LargeStruct_Stream_GoJson-16                                      21818             55451 ns/op           34467 B/op         74 allocs/op
Benchmark_Decode_LargeStruct_Stream_GoJsonFirstWinMode-16                          23778             50708 ns/op           34468 B/op         74 allocs/op

@goccy goccy merged commit f7eceb1 into master Jun 23, 2021
@goccy goccy deleted the feature/add-sonic-to-benchmark branch June 23, 2021 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant