{"id":23897931,"url":"https://github.com/byteszero/rust_api","last_synced_at":"2026-06-19T11:03:04.150Z","repository":{"id":193238694,"uuid":"688395646","full_name":"BytesZero/rust_api","owner":"BytesZero","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-20T11:07:45.000Z","size":3449,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-04T17:19:09.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/BytesZero.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":"2023-09-07T09:03:15.000Z","updated_at":"2023-09-07T09:03:22.000Z","dependencies_parsed_at":"2023-10-15T13:26:57.644Z","dependency_job_id":"9b1e27d9-665f-4af8-b025-5aea8f4d1ff7","html_url":"https://github.com/BytesZero/rust_api","commit_stats":null,"previous_names":["yy1300326388/rust_api","byteszero/rust_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2Frust_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2Frust_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2Frust_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2Frust_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BytesZero","download_url":"https://codeload.github.com/BytesZero/rust_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240286508,"owners_count":19777354,"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":[],"created_at":"2025-01-04T17:19:13.816Z","updated_at":"2025-11-14T11:03:10.678Z","avatar_url":"https://github.com/BytesZero.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 简单测试 Rust API 服务性能\n\n### 运行\n\n``` shell\ncargo run\n```\n\n### 测试（斐波那契数列）\n```\nwrk -t12 -c400 -d120s http://127.0.0.1:8080/fibonacci/80\n```\n\n### 结果\n\n```\nRunning 2m test @ http://127.0.0.1:8080/fibonacci/80\n  12 threads and 400 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     7.99ms    4.59ms 137.68ms   89.93%\n    Req/Sec     2.56k     1.24k    6.31k    63.54%\n  3670936 requests in 2.00m, 381.60MB read\n  Socket errors: connect 155, read 102, write 0, timeout 0\nRequests/sec:  30564.57\nTransfer/sec:      3.18MB\n```\n\n- [查看 Node JS 测试结果](https://github.com/yy1300326388/node_api)\n\n## Docker 部署\n\n```\ndocker build -t rust_api .\ndocker run -p 8080:8080 rust_api\n```\n\n## 对比测试结果\n|测试项|Rust|NodeJS|请求量|\n|--|--|--|--|\n|启动|![Rust](imgs/img5-start-Rust.png)|![NodeJS](imgs/img5-start-Node.png)|没有请求|\n|10线程|![Rust](imgs/img5-Rust-t10.png)|![NodeJS](imgs/img5-Node-t10.png)|![](imgs/img5-t10.png)|\n|100线程|![Rust](imgs/img5-Rust-t100.png)|![NodeJS](imgs/img5-Node-t100.png)|![](imgs/img5-t100.png)|\n|300线程|![Rust](imgs/img5-Rust-t300.png)|![NodeJS](imgs/img5-Node-t300.png)|![](imgs/img5-t300.png)|\n|500线程|![Rust](imgs/img5-Rust-t500.png)|![NodeJS](imgs/img5-Node-t500.png)|![](imgs/img5-t500.png)|\n|1000线程|![Rust](imgs/img5-Rust-t1000.png)|![NodeJS](imgs/img5-Node-t1000.png)|![](imgs/img5-t1000.png)|\n|2000线程|![Rust](imgs/img5-Rust-t2000.png)|![NodeJS](imgs/img5-Node-t2000.png)|![](imgs/img5-t2000.png)|\n|3000线程|![Rust](imgs/img5-Rust-t3000.png)|![NodeJS](imgs/img5-Node-t1000.png)|![](imgs/img5-t3000.png)|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Frust_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteszero%2Frust_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Frust_api/lists"}