{"id":24065985,"url":"https://github.com/ynachi/aio","last_synced_at":"2025-02-26T18:42:28.650Z","repository":{"id":269211197,"uuid":"906624249","full_name":"ynachi/aio","owner":"ynachi","description":"Let's experiment io_uring and async network programming in C++","archived":false,"fork":false,"pushed_at":"2025-02-11T21:53:23.000Z","size":29863,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T22:33:57.613Z","etag":null,"topics":["asynchronous-programming","asyncio","concurrency","coroutines","cpp20","iouring","network","socket-programming"],"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/ynachi.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}},"created_at":"2024-12-21T12:33:27.000Z","updated_at":"2025-02-01T16:42:36.000Z","dependencies_parsed_at":"2025-01-06T17:42:35.592Z","dependency_job_id":"a70ea85c-1254-4a70-b301-7b2838071e56","html_url":"https://github.com/ynachi/aio","commit_stats":null,"previous_names":["ynachi/aio"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynachi%2Faio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynachi%2Faio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynachi%2Faio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynachi%2Faio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ynachi","download_url":"https://codeload.github.com/ynachi/aio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240914334,"owners_count":19877952,"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":["asynchronous-programming","asyncio","concurrency","coroutines","cpp20","iouring","network","socket-programming"],"created_at":"2025-01-09T11:16:23.122Z","updated_at":"2025-02-26T18:42:28.476Z","avatar_url":"https://github.com/ynachi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aio\n\nLet's experiment io_uring and async network programming in C++\n\nThis is a work in progress. The goal is to create a simple and efficient async io library in C++ using io_uring.\nThe library supports files operations and network sockets. We use alibaba async_simple to take care of the coroutine\nmachinery.\n\n# How to build\n\n## First, install liburing 2.8 and pkg-config\n\n```shell\nsudo apt install pkg-config\nwget https://github.com/axboe/liburing/archive/refs/tags/liburing-2.8.tar.gz -O - | tar -xvz\ncd liburing-liburing-2.8\n./configure --prefix=/usr/local\nmake -C src -j $(nprocs)\nsudo make install\n```\n\n## Clone the repo with submodules\n\n```shell\ngit clone --recursive  https://github.com/ynachi/aio.git\n```\n\n## build\n\n```shell\n# example, build debug\ncmake --workflow --preset debug\n# after that, you will find binaries in build/debug/bin folder\n```\n\n# Demos/examples\n\nThis minimal version has been demoed with a simple echo server and a simple file read program.\n\n1. [echo server](./demos/low_level_tcp_server): demonstrates the usage of the low level io_uring wrapper to create an\n   async TCP server.\n2. [file read](./demos/char_count_low.cpp): demonstrates the usage of the low level io_uring wrapper to read a file.\n3. [echo_server_202](./demos/tcp_server_202.cpp): demonstrates the usage of higher level classes to build a TCP server.\n   In this example, the user still need to run the event loop himself.\n\nBemchmarks:\n\nExample with apache benchmark on a simple echo server.:  \nThe server running on a single core on AMD Ryzen 7 PRO 7840U with 64GB of DDR5 ram\n\n```shell\n➜  ~ ulimit -n 65535\n➜  ~ ab -n 10000000 -c 1000 -k http://127.0.0.1:8080/\nThis is ApacheBench, Version 2.3 \u003c$Revision: 1903618 $\u003e\nCopyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\nLicensed to The Apache Software Foundation, http://www.apache.org/\n\nBenchmarking 127.0.0.1 (be patient)\nCompleted 1000000 requests\nCompleted 2000000 requests\nCompleted 3000000 requests\nCompleted 4000000 requests\nCompleted 5000000 requests\nCompleted 6000000 requests\nCompleted 7000000 requests\nCompleted 8000000 requests\nCompleted 9000000 requests\nCompleted 10000000 requests\nFinished 10000000 requests\n\n\nServer Software:        \nServer Hostname:        127.0.0.1\nServer Port:            8080\n\nDocument Path:          /\nDocument Length:        0 bytes\n\nConcurrency Level:      1000\nTime taken for tests:   63.208 seconds\nComplete requests:      10000000\nFailed requests:        0\nNon-2xx responses:      10000000\nKeep-Alive requests:    10000000\nTotal transferred:      1060000000 bytes\nHTML transferred:       0 bytes\nRequests per second:    158206.65 [#/sec] (mean)\nTime per request:       6.321 [ms] (mean)\nTime per request:       0.006 [ms] (mean, across all concurrent requests)\nTransfer rate:          16376.86 [Kbytes/sec] received\n\nConnection Times (ms)\n              min  mean[+/-sd] median   max\nConnect:        0    0   0.3      0      41\nProcessing:     2    6   1.2      6      40\nWaiting:        0    6   1.2      6      23\nTotal:          2    6   1.3      6      63\n\nPercentage of the requests served within a certain time (ms)\n  50%      6\n  66%      6\n  75%      6\n  80%      6\n  90%      7\n  95%      8\n  98%      9\n  99%     15\n 100%     63 (longest request)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynachi%2Faio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fynachi%2Faio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynachi%2Faio/lists"}