{"id":14985621,"url":"https://github.com/rsheremeta/gob-serialization","last_synced_at":"2025-04-11T22:02:29.852Z","repository":{"id":171613409,"uuid":"620313337","full_name":"RSheremeta/gob-serialization","owner":"RSheremeta","description":"Benchmarking Gob vs other data formats like JSON, XML and YAML.","archived":false,"fork":false,"pushed_at":"2023-04-04T11:07:22.000Z","size":30,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T17:53:31.181Z","etag":null,"topics":["benchmark","benchmarking","go","gob","golang","json","serialization","xml","yaml","yml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RSheremeta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-28T12:47:49.000Z","updated_at":"2024-12-31T11:58:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b4df06e-a66a-4167-9c91-78b2464ef7f4","html_url":"https://github.com/RSheremeta/gob-serialization","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.08333333333333337,"last_synced_commit":"fdf35fc4a039a70588313127ec134aa9aafc48fc"},"previous_names":["rsheremeta/gob-serialization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RSheremeta%2Fgob-serialization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RSheremeta%2Fgob-serialization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RSheremeta%2Fgob-serialization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RSheremeta%2Fgob-serialization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RSheremeta","download_url":"https://codeload.github.com/RSheremeta/gob-serialization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487710,"owners_count":21112188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","benchmarking","go","gob","golang","json","serialization","xml","yaml","yml"],"created_at":"2024-09-24T14:11:22.614Z","updated_at":"2025-04-11T22:02:29.802Z","avatar_url":"https://github.com/RSheremeta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gob-serialization\n\n#### Benchmarking Gob vs other data formats like JSON, XML and YAML.\n\nThis repo is made just out of curiosity and has an experimental reasoning.\n\n### Description\nThere are 4 structs: `Tiny`, `Medium`, `Big`, `Huge` which are being compared against all the defined formats above. \nAnd there is a *separate* struct to compare **Gob vs JSON only** - a struct called `ComplexAndHuge` which holds a slice of `type complexMap map[string]Huge`.\n\nEach of them has a respective size and complexity.\nAnd each of them builds the following targets to run encoding \u0026 decoding benchmarks against: \n- `Single` means a single struct - eg - `Tiny{}`\n- `Slice` means a slice of given struct - eg - `[]Tiny`\n- `Pointer Slice` means a slice of pointers to given struct - eg - `[]*Tiny`\n\n### Usage\nYou can just look at and analyze the results I got while running on my machine by observing csv samples in **results_run/sample/** dir.\n\nAlso, feel free to play on your own by doing the following:\n\nRun a corresponding **Make** command in terminal and observe the results in **results_run/** dir.\nOtherwise run `make-all` in order to run everything. Warning: beware as it's a very CPU/RAM consuming operation.\n\n### Results\n**Software and Hardware:**\nThe experiment is run on:\n- MacBook Pro 2021 15\" with macOS Ventura 13.2.1 \n- 32gb RAM\n- Apple M1 Pro CPU\n- Go 1.19.5\n\nHere is the full analysis of mine about all the results run: [Analysis.md](https://github.com/RSheremeta/gob-serialization/blob/master/Analysis.md)\n\n[**map_ptr_slice_decode.csv:**](https://github.com/RSheremeta/gob-serialization/blob/master/results_run/sample/map_ptr_slice_decode.csv)\n\n```bash\ngoos: darwin\ngoarch: arm64\npkg: github.com/RSheremeta/gob-serialization\nBenchmarkDecodePtrSliceComplexMap/type=GOB_struct_size=huge_complex_map-10         \t      10\t 646447171 ns/op\t630836108 B/op\t11072058 allocs/op\nBenchmarkDecodePtrSliceComplexMap/type=JSON_struct_size=huge_complex_map-10        \t      10\t6356559012 ns/op\t1610172119 B/op\t18605410 allocs/op\nPASS\nok  \tgithub.com/RSheremeta/gob-serialization\t85.338s\n```\n\n[**all.csv:**](https://github.com/RSheremeta/gob-serialization/blob/master/results_run/sample/all.csv)\n\n```bash\ngoos: darwin\ngoarch: arm64\npkg: github.com/RSheremeta/gob-serialization\nBenchmarkEncodeSingle/type=GOB_struct_size=tiny-10         \t 1146312\t      1037 ns/op\t    1136 B/op\t      20 allocs/op\nBenchmarkEncodeSingle/type=JSON_struct_size=tiny-10        \t11647294\t       101.6 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkEncodeSingle/type=XML_struct_size=tiny-10         \t 1247809\t       960.3 ns/op\t    4560 B/op\t       9 allocs/op\nBenchmarkEncodeSingle/type=YAML_struct_size=tiny-10        \t  404588\t      2924 ns/op\t    6776 B/op\t      23 allocs/op\nBenchmarkEncodeSingle/type=GOB_struct_size=medium-10       \t  420466\t      2786 ns/op\t    1720 B/op\t      38 allocs/op\nBenchmarkEncodeSingle/type=JSON_struct_size=medium-10      \t 1995039\t       611.5 ns/op\t     240 B/op\t       2 allocs/op\nBenchmarkEncodeSingle/type=XML_struct_size=medium-10       \t  409347\t      2731 ns/op\t    5053 B/op\t      14 allocs/op\nBenchmarkEncodeSingle/type=YAML_struct_size=medium-10      \t  132667\t      8870 ns/op\t   17112 B/op\t      56 allocs/op\nBenchmarkEncodeSingle/type=GOB_struct_size=big-10          \t  227510\t      5232 ns/op\t    3072 B/op\t      65 allocs/op\nBenchmarkEncodeSingle/type=JSON_struct_size=big-10         \t  461298\t      2522 ns/op\t     944 B/op\t       6 allocs/op\nBenchmarkEncodeSingle/type=XML_struct_size=big-10          \t  127340\t      9153 ns/op\t    6034 B/op\t      21 allocs/op\nBenchmarkEncodeSingle/type=YAML_struct_size=big-10         \t   33507\t     34729 ns/op\t   80288 B/op\t     176 allocs/op\nBenchmarkEncodeSingle/type=GOB_struct_size=huge-10         \t     224\t   5244342 ns/op\t 7035920 B/op\t   44617 allocs/op\nBenchmarkEncodeSingle/type=JSON_struct_size=huge-10        \t      62\t  17295433 ns/op\t 6592181 B/op\t   39871 allocs/op\nBenchmarkEncodeSingle/type=XML_struct_size=huge-10         \t      14\t  78271318 ns/op\t19909926 B/op\t   97568 allocs/op\nBenchmarkEncodeSingle/type=YAML_struct_size=huge-10        \t       4\t 298569250 ns/op\t845118380 B/op\t 1215044 allocs/op\nBenchmarkDecodeSingle/type=GOB_struct_size=tiny-10         \t  132409\t      9390 ns/op\t    6760 B/op\t     179 allocs/op\nBenchmarkDecodeSingle/type=JSON_struct_size=tiny-10        \t 2591954\t       461.0 ns/op\t     248 B/op\t       6 allocs/op\nBenchmarkDecodeSingle/type=XML_struct_size=tiny-10         \t  627777\t      1931 ns/op\t    1480 B/op\t      33 allocs/op\nBenchmarkDecodeSingle/type=YAML_struct_size=tiny-10        \t  263422\t      4338 ns/op\t    7280 B/op\t      52 allocs/op\nBenchmarkDecodeSingle/type=GOB_struct_size=medium-10       \t   92902\t     12639 ns/op\t    8604 B/op\t     235 allocs/op\nBenchmarkDecodeSingle/type=JSON_struct_size=medium-10      \t  646796\t      1797 ns/op\t     440 B/op\t      14 allocs/op\nBenchmarkDecodeSingle/type=XML_struct_size=medium-10       \t  135865\t      9034 ns/op\t    3608 B/op\t      92 allocs/op\nBenchmarkDecodeSingle/type=YAML_struct_size=medium-10      \t  101642\t     11995 ns/op\t   10724 B/op\t     126 allocs/op\nBenchmarkDecodeSingle/type=GOB_struct_size=big-10          \t   69265\t     17420 ns/op\t   11557 B/op\t     324 allocs/op\nBenchmarkDecodeSingle/type=JSON_struct_size=big-10         \t  194416\t      6186 ns/op\t    1080 B/op\t      32 allocs/op\nBenchmarkDecodeSingle/type=XML_struct_size=big-10          \t   37994\t     31857 ns/op\t   10376 B/op\t     280 allocs/op\nBenchmarkDecodeSingle/type=YAML_struct_size=huge-10        \t   29328\t     40508 ns/op\t   23081 B/op\t     386 allocs/op\nBenchmarkDecodeSingle/type=GOB_struct_size=huge-10         \t     277\t   4408610 ns/op\t 4108664 B/op\t   71653 allocs/op\nBenchmarkDecodeSingle/type=JSON_struct_size=huge-10        \t      27\t  42904093 ns/op\t12024463 B/op\t  120170 allocs/op\nBenchmarkDecodeSingle/type=XML_struct_size=huge-10         \t       5\t 224652383 ns/op\t74270280 B/op\t 1836139 allocs/op\nBenchmarkDecodeSingle/type=YAML_struct_size=huge#01-10     \t       4\t 280739250 ns/op\t121876510 B/op\t 2425871 allocs/op\nBenchmarkEncodePtrSlice/type=GOB_struct_size=tiny-10       \t  766519\t      1588 ns/op\t    1392 B/op\t      22 allocs/op\nBenchmarkEncodePtrSlice/type=JSON_struct_size=tiny-10      \t 3311300\t       367.0 ns/op\t     176 B/op\t       1 allocs/op\nBenchmarkEncodePtrSlice/type=XML_struct_size=tiny-10       \t  523192\t      2330 ns/op\t    4816 B/op\t       9 allocs/op\nBenchmarkEncodePtrSlice/type=YAML_struct_size=tiny-10      \t  122904\t     11151 ns/op\t   36392 B/op\t      78 allocs/op\nBenchmarkEncodePtrSlice/type=GOB_struct_size=medium-10     \t  238899\t      5326 ns/op\t    4600 B/op\t      62 allocs/op\nBenchmarkEncodePtrSlice/type=JSON_struct_size=medium-10    \t  213715\t      5767 ns/op\t    2272 B/op\t      11 allocs/op\nBenchmarkEncodePtrSlice/type=XML_struct_size=medium-10     \t   46567\t     26118 ns/op\t    8773 B/op\t      51 allocs/op\nBenchmarkEncodePtrSlice/type=YAML_struct_size=medium-10    \t   15430\t     75262 ns/op\t  171416 B/op\t     494 allocs/op\nBenchmarkEncodePtrSlice/type=GOB_struct_size=big-10        \t   23326\t     49705 ns/op\t   68808 B/op\t     571 allocs/op\nBenchmarkEncodePtrSlice/type=JSON_struct_size=big-10       \t   10000\t    123179 ns/op\t   44774 B/op\t     251 allocs/op\nBenchmarkEncodePtrSlice/type=XML_struct_size=big-10        \t    2264\t    538901 ns/op\t  152597 B/op\t     715 allocs/op\nBenchmarkEncodePtrSlice/type=YAML_struct_size=big-10       \t     799\t   1538428 ns/op\t 4682072 B/op\t    8842 allocs/op\nBenchmarkEncodePtrSlice/type=GOB_struct_size=huge-10       \t       5\t 249447842 ns/op\t341030953 B/op\t 2226117 allocs/op\nBenchmarkEncodePtrSlice/type=JSON_struct_size=huge-10      \t       2\t 868415104 ns/op\t329189260 B/op\t 1993403 allocs/op\nBenchmarkEncodePtrSlice/type=XML_struct_size=huge-10       \t       1\t3949217375 ns/op\t1230326816 B/op\t 4877230 allocs/op\nBenchmarkEncodePtrSlice/type=YAML_struct_size=huge-10      \t       1\t17784455125 ns/op\t38385133288 B/op\t60748369 allocs/op\nBenchmarkDecodePtrSlice/type=GOB_struct_size=tiny-10       \t  105658\t     11314 ns/op\t    7724 B/op\t     208 allocs/op\nBenchmarkDecodePtrSlice/type=JSON_struct_size=tiny-10      \t  521919\t      2337 ns/op\t     544 B/op\t      20 allocs/op\nBenchmarkDecodePtrSlice/type=XML_struct_size=tiny-10       \t  540841\t      2240 ns/op\t    1536 B/op\t      36 allocs/op\nBenchmarkDecodePtrSlice/type=YAML_struct_size=tiny-10      \t   69958\t     17167 ns/op\t   12592 B/op\t     177 allocs/op\nBenchmarkDecodePtrSlice/type=GOB_struct_size=medium-10     \t   67569\t     17878 ns/op\t   11221 B/op\t     310 allocs/op\nBenchmarkDecodePtrSlice/type=JSON_struct_size=medium-10    \t   69162\t     17254 ns/op\t    2608 B/op\t      96 allocs/op\nBenchmarkDecodePtrSlice/type=XML_struct_size=medium-10     \t  128006\t      9378 ns/op\t    3664 B/op\t      95 allocs/op\nBenchmarkDecodePtrSlice/type=YAML_struct_size=medium-10    \t   10000\t    112053 ns/op\t   52418 B/op\t    1030 allocs/op\nBenchmarkDecodePtrSlice/type=GOB_struct_size=big-10        \t   16177\t     74428 ns/op\t   46335 B/op\t    1179 allocs/op\nBenchmarkDecodePtrSlice/type=JSON_struct_size=big-10       \t    3897\t    299794 ns/op\t   38088 B/op\t    1225 allocs/op\nBenchmarkDecodePtrSlice/type=XML_struct_size=big-10        \t   36422\t     32854 ns/op\t   10432 B/op\t     283 allocs/op\nBenchmarkDecodePtrSlice/type=YAML_struct_size=big-10       \t     561\t   2155220 ns/op\t  846919 B/op\t   17894 allocs/op\nBenchmarkDecodePtrSlice/type=GOB_struct_size=huge-10       \t      18\t  65971963 ns/op\t44990502 B/op\t     802 allocs/op\nBenchmarkDecodePtrSlice/type=JSON_struct_size=huge-10      \t       1\t1302005041 ns/op\t   14008 B/op\t      72 allocs/op\nBenchmarkDecodePtrSlice/type=XML_struct_size=huge-10       \t       8\t 128212328 ns/op\t48727516 B/op\t 1374540 allocs/op\nBenchmarkDecodePtrSlice/type=YAML_struct_size=huge-10      \t       1\t12199034416 ns/op\t5480352464 B/op\t96667450 allocs/op\nBenchmarkEncodeSlice/type=GOB_struct_size=tiny-10          \t  747290\t      1678 ns/op\t    1392 B/op\t      22 allocs/op\nBenchmarkEncodeSlice/type=JSON_struct_size=tiny-10         \t 2159914\t       558.1 ns/op\t     320 B/op\t       1 allocs/op\nBenchmarkEncodeSlice/type=XML_struct_size=tiny-10          \t  321912\t      3843 ns/op\t    5072 B/op\t       9 allocs/op\nBenchmarkEncodeSlice/type=YAML_struct_size=tiny-10         \t   73617\t     17534 ns/op\t   37584 B/op\t     129 allocs/op\nBenchmarkEncodeSlice/type=GOB_struct_size=medium-10        \t  197379\t      6180 ns/op\t    4600 B/op\t      62 allocs/op\nBenchmarkEncodeSlice/type=JSON_struct_size=medium-10       \t  116884\t     10030 ns/op\t    4416 B/op\t      21 allocs/op\nBenchmarkEncodeSlice/type=XML_struct_size=medium-10        \t   25900\t     46562 ns/op\t   18709 B/op\t      72 allocs/op\nBenchmarkEncodeSlice/type=YAML_struct_size=medium-10       \t    9133\t    143216 ns/op\t  340952 B/op\t     877 allocs/op\nBenchmarkEncodeSlice/type=GOB_struct_size=big-10           \t   18789\t     64469 ns/op\t   69400 B/op\t     571 allocs/op\nBenchmarkEncodeSlice/type=JSON_struct_size=big-10          \t    6282\t    197420 ns/op\t   78944 B/op\t     451 allocs/op\nBenchmarkEncodeSlice/type=XML_struct_size=big-10           \t    1371\t    889912 ns/op\t  298069 B/op\t    1116 allocs/op\nBenchmarkEncodeSlice/type=YAML_struct_size=big-10          \t     487\t   2359149 ns/op\t 6520168 B/op\t   13745 allocs/op\nBenchmarkEncodeSlice/type=GOB_struct_size=huge-10          \t       5\t 246363042 ns/op\t341030620 B/op\t 2226116 allocs/op\nBenchmarkEncodeSlice/type=JSON_struct_size=huge-10         \t       2\t 869657292 ns/op\t597634568 B/op\t 1993422 allocs/op\nBenchmarkEncodeSlice/type=XML_struct_size=huge-10          \t       1\t3874216916 ns/op\t1230326832 B/op\t 4877230 allocs/op\nBenchmarkEncodeSlice/type=YAML_struct_size=huge-10         \t       1\t16234461667 ns/op\t38385152888 B/op\t60749219 allocs/op\nBenchmarkDecodeSlice/type=GOB_struct_size=tiny-10          \t  101436\t     11605 ns/op\t    7812 B/op\t     203 allocs/op\nBenchmarkDecodeSlice/type=JSON_struct_size=tiny-10         \t  282842\t      4248 ns/op\t    1176 B/op\t      19 allocs/op\nBenchmarkDecodeSlice/type=XML_struct_size=tiny-10          \t  596376\t      2057 ns/op\t    1488 B/op\t      32 allocs/op\nBenchmarkDecodeSlice/type=YAML_struct_size=tiny-10         \t   40621\t     29642 ns/op\t   18280 B/op\t     278 allocs/op\nBenchmarkDecodeSlice/type=GOB_struct_size=medium-10        \t   66992\t     17821 ns/op\t   11973 B/op\t     300 allocs/op\nBenchmarkDecodeSlice/type=JSON_struct_size=medium-10       \t   35984\t     33182 ns/op\t    9120 B/op\t     100 allocs/op\nBenchmarkDecodeSlice/type=XML_struct_size=medium-10        \t  172459\t      6964 ns/op\t    2872 B/op\t      66 allocs/op\nBenchmarkDecodeSlice/type=YAML_struct_size=medium-10       \t    5738\t    208889 ns/op\t   95046 B/op\t    1791 allocs/op\nBenchmarkDecodeSlice/type=GOB_struct_size=big-10           \t   15175\t     78775 ns/op\t   58495 B/op\t    1129 allocs/op\nBenchmarkDecodeSlice/type=JSON_struct_size=big-10          \t    2388\t    497792 ns/op\t  141000 B/op\t    1379 allocs/op\nBenchmarkDecodeSlice/type=XML_struct_size=big-10           \t   62374\t     19358 ns/op\t    6200 B/op\t     152 allocs/op\nBenchmarkDecodeSlice/type=YAML_struct_size=big-10          \t     349\t   3426646 ns/op\t 1381654 B/op\t   27396 allocs/op\nBenchmarkDecodeSlice/type=GOB_struct_size=huge-10          \t       5\t 209612733 ns/op\t204711942 B/op\t 3565079 allocs/op\nBenchmarkDecodeSlice/type=JSON_struct_size=huge-10         \t       1\t2101034833 ns/op\t601242440 B/op\t 6008030 allocs/op\nBenchmarkDecodeSlice/type=XML_struct_size=huge-10          \t 1652984\t       722.0 ns/op\t     920 B/op\t      15 allocs/op\nBenchmarkDecodeSlice/type=YAML_struct_size=huge-10         \t       1\t14744372417 ns/op\t6093520992 B/op\t121293601 allocs/op\nPASS\nok  \tgithub.com/RSheremeta/gob-serialization\t285.131s\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsheremeta%2Fgob-serialization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsheremeta%2Fgob-serialization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsheremeta%2Fgob-serialization/lists"}