{"id":13712276,"url":"https://github.com/alecthomas/go_serialization_benchmarks","last_synced_at":"2025-05-15T09:00:17.840Z","repository":{"id":6449990,"uuid":"7689517","full_name":"alecthomas/go_serialization_benchmarks","owner":"alecthomas","description":"Benchmarks of Go serialization methods","archived":false,"fork":false,"pushed_at":"2024-08-30T21:31:12.000Z","size":744,"stargazers_count":1585,"open_issues_count":6,"forks_count":157,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-04-11T19:55:16.597Z","etag":null,"topics":["benchmarking","go","golang"],"latest_commit_sha":null,"homepage":"https://alecthomas.github.io/go_serialization_benchmarks/","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/alecthomas.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-01-18T16:03:58.000Z","updated_at":"2025-04-06T20:01:46.000Z","dependencies_parsed_at":"2024-05-22T22:28:21.006Z","dependency_job_id":"7f5d4bd7-0325-4fa6-8033-5226542aa45f","html_url":"https://github.com/alecthomas/go_serialization_benchmarks","commit_stats":{"total_commits":158,"total_committers":49,"mean_commits":"3.2244897959183674","dds":0.7025316455696202,"last_synced_commit":"630ee59b8e562c71aaf72605b5e2048a26489db4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fgo_serialization_benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fgo_serialization_benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fgo_serialization_benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fgo_serialization_benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alecthomas","download_url":"https://codeload.github.com/alecthomas/go_serialization_benchmarks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310509,"owners_count":22049467,"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":["benchmarking","go","golang"],"created_at":"2024-08-02T23:01:16.628Z","updated_at":"2025-05-15T09:00:17.458Z","avatar_url":"https://github.com/alecthomas.png","language":"Go","readme":"# Benchmarks of Go serialization methods\n\n[![Gitter chat](https://badges.gitter.im/alecthomas.png)](https://gitter.im/alecthomas/Lobby)\n\nThis is a test suite for benchmarking various Go serialization methods.\n\n# Current Serialization Results\n\nhttps://alecthomas.github.io/go_serialization_benchmarks\n\n## Running the benchmarks\n\nTo benchmark and validate, without cloning the repository, replace the `.` from the commands below with `github.com/alecthomas/go_serialization_benchmarks@latest`.\n\n```bash\ngo run .\n```\n\nTo validate the correctness of the serializers:\n```bash\ngo run . --validate\n```\n\nTo update the benchmark report:\n```bash\ngo run . --genreport\n```\n\nTo update the benchmark report with a longer benchmark run (to get more accurate results):\n```bash\ngo test -tags genreport -run TestGenerateReport -benchtime 10s -timeout 1h #--validate\n```\n\n## Recommendation\n\nIf correctness and interoperability are the most\nimportant factors [JSON](http://golang.org/pkg/encoding/json/) or [Protobuf](https://google.golang.org/protobuf) are your best options.\n\nBut as always, make your own choice based on your requirements.\n\n## Adding New Serializers\n\nReview the following instructions _before_ opening the PR to add a new\nserializer:\n\n- Create all the required serializer code in `internal/\u003cshort serializer name\u003e`.\n- Add an entry to the serializer in [benchmarks.go](benchmarks.go).\n- If the serializer supports both reusing/not reusing its marshalling buffer:\n  - Add both a `serializer` and `serializer/reuse` entries, each one\n    respectively reusing/not reusing the resulting marshalling buffer. Set the\n    `BufferReuseMarshal` flag accordingly.\n- If the serializer supports both safe and unsafe string unmarshalling:\n  - Add both a `serializer` and `serializer/unsafe` entries, each one\n    respectively unmarshalling into safe and unsafe strings. Set the\n    `UnsafeStringUnmarshal` flag accordingly.\n- If the serializer supports both marshalling buffer reuse and unsafe string\n  unmarshalling, merge both options into a single `serializer/unsafe_reuse`\n  entry (check the baseline serializer for an example).\n- Regenerate the report by running:\n\n```\ngo run . --genreport\n```\n\n- **Include the updated report data in your PR**\n\n## Data\n\nThe data being serialized is the following structure with randomly generated values:\n\n```go\ntype A struct {\n    Name     string\n    BirthDay time.Time\n    Phone    string\n    Siblings int\n    Spouse   bool\n    Money    float64\n}\n```\n\n","funding_links":[],"categories":["Benchmarks","基准点","Go","基准","Twitter"],"sub_categories":["Other Software","其他软件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecthomas%2Fgo_serialization_benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecthomas%2Fgo_serialization_benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecthomas%2Fgo_serialization_benchmarks/lists"}