{"id":31274054,"url":"https://github.com/f1shl3gs/prust","last_synced_at":"2026-05-16T11:33:11.344Z","repository":{"id":315633645,"uuid":"1060285065","full_name":"f1shl3gs/prust","owner":"f1shl3gs","description":"A lightweight, ultra-fast and prue Rust implementation of Protobuf","archived":false,"fork":false,"pushed_at":"2026-05-11T02:27:19.000Z","size":912,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-11T04:35:02.642Z","etag":null,"topics":["grpc","protobuf","rust","tonic"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/f1shl3gs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-19T16:57:59.000Z","updated_at":"2026-05-11T02:27:24.000Z","dependencies_parsed_at":"2025-09-19T19:56:24.005Z","dependency_job_id":"74c97302-1f0a-4570-adcb-7d8443a19bd9","html_url":"https://github.com/f1shl3gs/prust","commit_stats":null,"previous_names":["f1shl3gs/prust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/f1shl3gs/prust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1shl3gs%2Fprust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1shl3gs%2Fprust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1shl3gs%2Fprust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1shl3gs%2Fprust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f1shl3gs","download_url":"https://codeload.github.com/f1shl3gs/prust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1shl3gs%2Fprust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33100862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["grpc","protobuf","rust","tonic"],"created_at":"2025-09-23T22:30:33.336Z","updated_at":"2026-05-16T11:33:11.338Z","avatar_url":"https://github.com/f1shl3gs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prust\n\nEnglish | [中文](README_cn.md)\n\n`prust` is a protobuf implementation for Rust. `prust` generates simple \nand high performance code from `proto2` or `proto3` files.\n\nCompare to other implementations\n- Highly optimized code, `prust` calculates everything when generating, \nso less calculating at runtime\n- Zero dependency, `prust` do not need that, no extra bloat\n- `grpc` is supported by default (with [tonic](https://github.com/hyperium/tonic))\n- Less build time, since we don't need to expand proc macros\n- `group` is not supported, since it is deprecated too.\n- No more `protoc`, `prust` handles parsing itself. \n\n### Sizes\n`prust` generates structs and implements `Deserialize` and `Serialize`,\nso the generated file is a little bit larger than `prost`, but still \nsmaller than the prost's expanded code.\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e File \u003c/th\u003e\n            \u003cth\u003e Crate \u003c/th\u003e\n            \u003cth\u003e Lines \u003c/th\u003e\n            \u003cth\u003e Sizes \u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=2\u003eproto2/data_types.proto\u003c/td\u003e\n            \u003ctd\u003e prust \u003c/td\u003e\n            \u003ctd\u003e 423 \u003c/td\u003e\n            \u003ctd\u003e 18054 \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e prost \u003c/td\u003e\n            \u003ctd\u003e 165 \u003c/td\u003e\n            \u003ctd\u003e 6571 \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=2\u003e proto3/data_types.proto \u003c/td\u003e\n            \u003ctd\u003e prust \u003c/td\u003e\n            \u003ctd\u003e 383 \u003c/td\u003e\n            \u003ctd\u003e 17540 \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e prost \u003c/td\u003e\n            \u003ctd\u003e 165 \u003c/td\u003e\n            \u003ctd\u003e 6603 \u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n### Performance\nWith our [workload](perf/proto/perf.proto) which covers lots of cases, `prust` works very well. \nThe decoding performance almost catch up `quick-protobuf`, which uses `Cow` to \nimprove performance(while `prust` don't ). And the encoding performance is around 2x \nfaster than `prost`. With different workload, `prust` performance will be different\ntoo, users must verify it if you want to switch to `prust`.\n\n```text\nDecoding 6000 times\nprost:   977.79 op/s,   382.65 M/s, 6.14s\nquick:  1521.15 op/s,   595.30 M/s, 3.94s\nprust:  1314.54 op/s,   514.44 M/s, 4.56s\n\nEncoding 6000 times\nprost:  1569.92 op/s,   614.38 M/s, 3.82s\nquick:  3295.58 op/s,  1289.71 M/s, 1.82s\nprust:  4247.97 op/s,  1662.43 M/s, 1.41s\n```\n\n`NOTE`: `prost` seems leak memory, it takes 2.1G to finish our test, while others takes only 1.1M.\n\n## Example\n- Add `prust` and `prust-build` to your Cargo.toml \n```toml\n[build-dependencies]\nprust-build = 0.1\n \n[dependencies]\nprust = 0.1\n```\n\n- add compile functions to `build.rs` \n```rust\nfn main() {\n    prust_build::Config::default()\n        .compile(\u0026[\"/path/to/include\"], \u0026[\"/path/to/your.proto\"])\n        .unwrap();\n}\n```\n\n- Include whatever the prust generated\n\nNote: by default, generated filename is `package` field in `*.proto`, if it is not specified, \n`prust` will use the `proto`'s filename.\n```rust\nmod proto {\n    include!(concat!(env!(\"OUT_DIR\"), \"/package.rs\"));\n}\n\nuse proto::Data;\nuse prust::{Deserialize, Serialize};\n\nfn main() {\n    let data = Data::decode(input).unwrap();\n\n    let len = data.encoded_len();\n    let buf = vec![0; len];\n    data.encode(\u0026mut buf).unwrap();\n}\n```\n\n## Grpc\nGrpc is supported and the generated file works with `tonic`, \nand the generated file is just like `tonic` does, so switching from `tonic`\nto `prust` is very easy.\n1. enable `tonic` feature of `prust`\n2. fix the use path in your rust file\n3. running your program or test\n\nA running example can be found in the [conformance/tests/services/health.rs](conformance/tests/services/health.rs)\n\n## TODO\n- ~~implement default value for map's key and value, which will reduce \nencoded size and resource usage~~ it hurt the performance a little bit.\n- it seems that access data via `*const u8` is better than `slice[pos]`, \nmore test needed.\n- `prust` cannot handle recursive types\n- BMI2 optimization -- I don't have any relatively modern CPU for testing， however,\n    given that the underlying implementation for `packed/proto3`'s `repeated int32/int64/...`\n    fields utilizes VARINT encoding, the performance improvement should be significant.\n\n## Not Supported yet\n\n- [Well-Known Types](https://protobuf.dev/reference/protobuf/google.protobuf/)\n- recursive types\n- records for `repeated` filed do not need to appear consecutively https://protobuf.dev/programming-guides/encoding/#repeated\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff1shl3gs%2Fprust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff1shl3gs%2Fprust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff1shl3gs%2Fprust/lists"}