{"id":16767955,"url":"https://github.com/davidzeng0/xe","last_synced_at":"2025-11-02T03:30:28.351Z","repository":{"id":49851121,"uuid":"369410112","full_name":"davidzeng0/xe","owner":"davidzeng0","description":"Io Uring Event Library. Ported to Rust @ https://github.com/davidyz0/xx-pulse","archived":true,"fork":false,"pushed_at":"2024-10-22T01:15:58.000Z","size":400,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T15:14:14.240Z","etag":null,"topics":["asyncio","coroutines","cpp","event-loop","io-uring","linux"],"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/davidzeng0.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":"2021-05-21T04:10:19.000Z","updated_at":"2025-02-07T23:02:13.000Z","dependencies_parsed_at":"2024-10-23T02:56:38.169Z","dependency_job_id":"0492c6a7-bbb3-49e7-bac0-23c4cf780fe7","html_url":"https://github.com/davidzeng0/xe","commit_stats":null,"previous_names":["davidyz0/xe","davidzeng0/xe"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidzeng0%2Fxe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidzeng0%2Fxe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidzeng0%2Fxe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidzeng0%2Fxe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidzeng0","download_url":"https://codeload.github.com/davidzeng0/xe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239370519,"owners_count":19627444,"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":["asyncio","coroutines","cpp","event-loop","io-uring","linux"],"created_at":"2024-10-13T06:10:25.459Z","updated_at":"2025-11-02T03:30:28.302Z","avatar_url":"https://github.com/davidzeng0.png","language":"C++","readme":"# xe\n\nHyper Fast io_uring Async I/O Library\n\nDocumentation is still WIP\n\n### Features\n#### xe\n- High Performance\n- Low Latency I/O\n- Fast Nanosecond Precision Timers\n- Ultra Lightweight (0.6% overhead for [echoserver](example/echoserver.cc))\n\n#### xe/io\n- Socket and File classes and utilities\n- Epoll/libuv-like [fast poll handle](example/pollechoserver.cc)\n\n#### xurl (WIP)\n- Async DNS resolution\n- HTTP, WS, and FILE url protocols (WIP)\n\n### Benchmarks\n\n| Library | Speed | %             |\n| ------- | ----- | ------------- |\n| xe      | 363K  | 100.0 %       |\n| l4cpp   | 362K  | \u0026nbsp;99.8  % |\n| frevib  | 353K  | \u0026nbsp;97.3  % |\n| epoll   | 351K  | \u0026nbsp;96.8  % |\n| photon  | 305K  | \u0026nbsp;84.1  % |\n\nSee [benchmarks](benchmarks/benchmarks.md)\n\n### Examples\n```c++\n// hello world snippet\nstatic task run(xe_loop\u0026 loop){\n\tchar msg[] = \"Hello World!\\n\";\n\n\tco_await loop.queue(xe_op::write(STDOUT_FILENO, msg, sizeof(msg) - 1, 0));\n}\n```\nAbove snippet from [hello_world.cc](example/coroutines/hello_world.cc)\n```c++\n// echo server snippet\nstatic task echo(xe_socket\u0026 socket){\n\tbyte buf[16384];\n\tint result;\n\n\twhile(true){\n\t\tresult = co_await socket.recv(buf, 16384, 0);\n\n\t\tif(result \u003c= 0)\n\t\t\tbreak;\n\t\tresult = co_await socket.send(buf, result, 0);\n\n\t\tif(result \u003c 0)\n\t\t\tbreak;\n\t}\n}\n```\nAbove snippet from [echoserver.cc](example/coroutines/echoserver.cc)\n\nSee [examples](example) and [coroutine examples](example/coroutines)\n\n### Running Examples\n##### See [Building xe](#build-xe) below\n```bash\ncd build\n./coroutine_hello_world\n./timer\n./coroutine_file\n./http # only if xurl enabled with openssl or wolfssl\n./coroutine_echoserver\n./echoserver\n```\n\n### Using\n\n#### Prerequisites\n- Linux Kernel 5.11 or later\n- liburing \u003ccode\u003eapt install liburing-dev\u003c/code\u003e or install from [source](https://github.com/axboe/liburing)\n- cmake \u003ccode\u003eapt install cmake\u003c/code\u003e\n- g++ 10 or newer, or clang 12 or newer \u003ccode\u003eapt install g++-10/clang++-12\u003c/code\u003e\n\n#### xurl prerequisites (only if enabled, disabled by default)\n- c-ares \u003ccode\u003eapt install libc-ares-dev\u003c/code\u003e or install from [source](https://github.com/c-ares/c-ares)\n\nOne of:\n- OpenSSL \u003e= 1.1.1 \u003ccode\u003eapt install libssl-dev\u003c/code\u003e\n- wolfSSL (must be installed from [source](https://github.com/wolfSSL/wolfssl), see [build flags](build.sh#L9))\n\n#### Use with cmake\n```cmake\nproject(sample CXX)\n\n# remove two lines below to disable xurl\nset(XE_ENABLE_XURL ON)\nset(XE_USE_OPENSSL ON) # alternatively set(XE_USE_WOLFSSL ON)\n\nFetchContent_Declare(xe GIT_REPOSITORY https://github.com/davidzeng0/xe.git GIT_TAG master)\nFetchContent_MakeAvailable(xe)\n\n...\n\ntarget_link_libraries(sample xe)\n\n# with xurl\ntarget_link_libraries(sample xe xurl)\n```\n\n#### Build xe\n```bash\nmkdir build; cd build\n\n# with ninja\ncmake -G \"Ninja\" -DCMAKE_BUILD_TYPE=\"Release\" -DCMAKE_CXX_COMPILER=\"/your/cxx/compiler\" ..\n# enable xurl and use openssl\ncmake -G \"Ninja\" -DXE_ENABLE_XURL=\"ON\" -DXE_USE_OPENSSL=\"ON\" -DCMAKE_BUILD_TYPE=\"Release\" -DCMAKE_CXX_COMPILER=\"/your/cxx/compiler\" ..\n\n# without ninja\ncmake -DCMAKE_BUILD_TYPE=\"Release\" -DCMAKE_CXX_COMPILER=\"/your/cxx/compiler\" ..\n\ncmake --build .\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidzeng0%2Fxe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidzeng0%2Fxe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidzeng0%2Fxe/lists"}