{"id":16442990,"url":"https://github.com/skyzh/uring-positioned-io","last_synced_at":"2025-03-21T05:30:29.492Z","repository":{"id":54166019,"uuid":"333441394","full_name":"skyzh/uring-positioned-io","owner":"skyzh","description":"Async positioned I/O with io_uring.","archived":false,"fork":false,"pushed_at":"2021-03-05T19:50:31.000Z","size":56,"stargazers_count":43,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T03:16:35.344Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skyzh.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}},"created_at":"2021-01-27T14:09:56.000Z","updated_at":"2025-02-21T18:10:39.000Z","dependencies_parsed_at":"2022-08-13T08:10:19.525Z","dependency_job_id":null,"html_url":"https://github.com/skyzh/uring-positioned-io","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzh%2Furing-positioned-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzh%2Furing-positioned-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzh%2Furing-positioned-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzh%2Furing-positioned-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyzh","download_url":"https://codeload.github.com/skyzh/uring-positioned-io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244113623,"owners_count":20400184,"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":"2024-10-11T09:19:12.738Z","updated_at":"2025-03-21T05:30:29.127Z","avatar_url":"https://github.com/skyzh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uring-positioned-io\n\nFully asynchronized positioned I/O with io_uring.\n\n## Basic Usage\n\n```rust\nlet files = vec![File::open(\"test.txt\").unwrap()];\nlet context = UringContext::new(files, 256, 1, false).unwrap();\nlet mut buf = vec![0; 4];\nlet (_, sz) = context.read(0, 0, \u0026mut buf).await.unwrap();\nassert_eq!(\u0026buf[..sz], b\"test\");\n```\n\n## Limitations\n\nRead buffer must be valid until a read is complete. This means that you must\npoll a read future until completion. You could not abort a read future. Later\nwe may mark `read` as `unsafe`.\n\n## Benchmark\n\nFirst, generate benchmark 128 files, with 1GB (262144 * 4K block) size each. Each block is filled\nwith `hash(file_id, block_id)`.\n\n```bash\ncargo run -p uring_bench --release generate --nf 128 --nb 262144 --dir ~/Work/uring_bench\n```\n\nThen, benchmark with `io_uring`. Benchmark script will read 4K block and verify it.\n\n```bash\nRUST_LOG=info cargo run -p uring_bench --release -- read --nf 128 --nb 262144 --dir ~/Work/uring_bench --duration 60 --concurrent 32 --ql 512\nRUST_LOG=info cargo run -p uring_bench --release -- read --nf 128 --nb 262144 --dir ~/Work/uring_bench --duration 60 --concurrent 512 --ql 512\n```\n\nFinally, compare `io_uring` with `mmap` by benchmarking.\n\n```bash\nRUST_LOG=info cargo run -p uring_bench --release -- read_mmap --nf 128 --nb 262144 --dir ~/Work/uring_bench --duration 60 --threads 8\nRUST_LOG=info cargo run -p uring_bench --release -- read_mmap --nf 128 --nb 262144 --dir ~/Work/uring_bench --duration 60 --threads 32\n```\n\nBenchmark result can be found on [my blog](https://www.skyzh.dev/posts/articles/2021-01-30-async-random-read-with-rust/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyzh%2Furing-positioned-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyzh%2Furing-positioned-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyzh%2Furing-positioned-io/lists"}