{"id":20588054,"url":"https://github.com/stalomeow/protobuf-unity","last_synced_at":"2025-10-27T21:02:23.993Z","repository":{"id":192542209,"uuid":"686674844","full_name":"stalomeow/Protobuf-Unity","owner":"stalomeow","description":"Protocol Buffers package for Unity.","archived":false,"fork":false,"pushed_at":"2024-02-03T13:44:06.000Z","size":665,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T09:51:28.256Z","etag":null,"topics":["protobuf","protocol-buffers","serialization","unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stalomeow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2023-09-03T15:25:50.000Z","updated_at":"2025-01-20T09:17:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b672668-de0c-4e74-91ad-d2a43e118cbf","html_url":"https://github.com/stalomeow/Protobuf-Unity","commit_stats":null,"previous_names":["stalomeow/protobuf-unity"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FProtobuf-Unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FProtobuf-Unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FProtobuf-Unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FProtobuf-Unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stalomeow","download_url":"https://codeload.github.com/stalomeow/Protobuf-Unity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248966449,"owners_count":21190772,"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":["protobuf","protocol-buffers","serialization","unity","unity3d"],"created_at":"2024-11-16T07:20:36.226Z","updated_at":"2025-10-27T21:02:18.950Z","avatar_url":"https://github.com/stalomeow.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protocol Buffers for Unity\n\n[![openupm](https://img.shields.io/npm/v/com.stalomeow.google-protobuf?label=openupm\u0026registry_uri=https://package.openupm.com)](https://openupm.cn/packages/com.stalomeow.google-protobuf/)\n\n**None of the repo, the tool, nor the repo owner is affiliated with, or sponsored or authorized by, Google or its affiliates.**\n\n## Overview\n\nProtocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. For more information, please check the original repository at [https://github.com/protocolbuffers/protobuf](https://github.com/protocolbuffers/protobuf).\n\nThis repository provides a Unity package that utilizes [my forked version of Protocol Buffers](https://github.com/stalomeow/protobuf/tree/unity), incorporating several optimizations.\n\n## Requirements\n\n- Unity \u003e= 2021.3.\n- Mono Cecil \u003e= 1.10.1.\n\n## Highlights\n\n### Fast String\n\nFaster string parsing by defining `GOOGLE_PROTOBUF_SUPPORT_FAST_STRING`.\n\n### Message Pool \u0026 Protoc\n\nThis package provides a thread-safe object pool for Protobuf Messages. \n\n- Usage 1\n\n    ``` csharp\n    var msg = ExampleMessage.NewFromPool();\n    // ...\n    msg.Dispose(); // recycle to pool\n    ```\n\n- Usage 2\n\n    ``` csharp\n    var msg = ExampleMessage.Parser.ParseFrom(data);\n    // ...\n    msg.Dispose(); // recycle to pool\n    ```\n\nThe protoc that supports this feature is available here: [https://github.com/stalomeow/protobuf/tree/unity](https://github.com/stalomeow/protobuf/tree/unity); simply compile it according to the documentation, and you'll be able to use it.\n\n## Best Practices in Unity\n\n- **DO NOT** use `foreach` on a Repeated/Map Field because it will cause extra GC allocation. Simply use `for` instead (if possible).\n- **DO** use\n\n    - `MessageParser\u003cT\u003e.ParseFrom(ReadOnlySpan\u003cbyte\u003e data)`\n    - `MessageParser\u003cT\u003e.ParseFrom(ReadOnlySequence\u003cbyte\u003e data)`\n    - `MessageExtensions.WriteTo(this IMessage message, Span\u003cbyte\u003e output)`\n    \n    when deserializing/serializing Messages because they do not cause extra GC allocation.\n- Others can be found in [Protobuf's Official Document](https://protobuf.dev/programming-guides/dos-donts/).\n- To be continued...\n\n## License\n\nThe codes in the Runtime/Core folder are licensed under [Google's LICENSE](Runtime/Core/LICENSE), and the rest are licensed under [the MIT LICENSE](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstalomeow%2Fprotobuf-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstalomeow%2Fprotobuf-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstalomeow%2Fprotobuf-unity/lists"}