{"id":31939674,"url":"https://github.com/alibaba/photonlibos","last_synced_at":"2025-10-14T08:44:50.120Z","repository":{"id":37005930,"uuid":"500338009","full_name":"alibaba/PhotonLibOS","owner":"alibaba","description":"Probably the fastest coroutine lib in the world!","archived":false,"fork":false,"pushed_at":"2025-09-25T01:44:31.000Z","size":5319,"stargazers_count":1092,"open_issues_count":32,"forks_count":151,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-09-25T03:43:18.509Z","etag":null,"topics":["async-io","coroutine","cpp","fs-library","http","iouring","libos","net-library","rpc"],"latest_commit_sha":null,"homepage":"https://PhotonLibOS.github.io","language":"C++","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/alibaba.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":"2022-06-06T07:43:07.000Z","updated_at":"2025-09-22T05:48:38.000Z","dependencies_parsed_at":"2023-11-06T03:29:00.746Z","dependency_job_id":"342de1b6-1878-45cf-904f-a7370ae8f7db","html_url":"https://github.com/alibaba/PhotonLibOS","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/alibaba/PhotonLibOS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FPhotonLibOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FPhotonLibOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FPhotonLibOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FPhotonLibOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alibaba","download_url":"https://codeload.github.com/alibaba/PhotonLibOS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FPhotonLibOS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018302,"owners_count":26086345,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["async-io","coroutine","cpp","fs-library","http","iouring","libos","net-library","rpc"],"created_at":"2025-10-14T08:44:47.314Z","updated_at":"2025-10-14T08:44:50.111Z","avatar_url":"https://github.com/alibaba.png","language":"C++","readme":"# PhotonLibOS\n\n[![Linux x86_64](https://github.com/alibaba/PhotonLibOS/actions/workflows/ci.linux.x86_64.yml/badge.svg?branch=main)](https://github.com/alibaba/PhotonLibOS/actions/workflows/ci.linux.x86_64.yml)\n[![Linux ARM](https://github.com/alibaba/PhotonLibOS/actions/workflows/ci.linux.arm.yml/badge.svg)](https://github.com/alibaba/PhotonLibOS/actions/workflows/ci.linux.arm.yml)\n[![macOS x86_64](https://github.com/alibaba/PhotonLibOS/actions/workflows/ci.macos.x86_64.yml/badge.svg)](https://github.com/alibaba/PhotonLibOS/actions/workflows/ci.macos.x86_64.yml)\n[![macOS ARM](https://github.com/alibaba/PhotonLibOS/actions/workflows/ci.macos.arm.yml/badge.svg)](https://github.com/alibaba/PhotonLibOS/actions/workflows/ci.macos.arm.yml)\n\n[PhotonlibOS.github.io](https://photonlibos.github.io)\n\n## What's New\n* Photon has been included in [awesome-cpp](https://github.com/fffaraz/awesome-cpp).\n* Version 0.9 has been released in April 2025.\n* We present an article to illustrate the theory of Photon's coroutine.\n[Stackful Coroutine Made Fast](https://photonlibos.github.io/blog/stackful-coroutine-made-fast)\n* Version 0.8 has been released in August 2024\n* Feb 2024，[中文文档](https://photonlibos.github.io/cn/docs/category/introduction)在官网上线了\n* Since 0.7, Photon will use release branches to enhance the reliability of software delivery. Bugfix will be merged into a stable release at first, then to higher release versions, and finally main.\n* Since version 0.6, Photon can run with a userspace TCP/IP stack on top of `DPDK`.\n[En](https://developer.aliyun.com/article/1208512) / [中文](https://developer.aliyun.com/article/1208390).\n* How to transform `RocksDB` from multi-threads to coroutines by only 200 lines of code?\n[En](https://github.com/facebook/rocksdb/issues/11017) / [中文](https://developer.aliyun.com/article/1093864).\n\n\u003cdetails\u003e\u003csummary\u003eClick to show more history...\u003c/summary\u003e\u003cp\u003e\n\n* Version 0.5 is released. Except for various performance improvements, including spinlock, context switch,\n  and new run queue for coroutine scheduling, we have re-implemented the HTTP module so that there is no `boost` dependency anymore.\n* Version 0.4 has come, bringing us these three major features:\n  1. Support coroutine local variables. Similar to the C++11 `thread_local` keyword. See [doc](doc/thread-local.md).\n  2. Support running on macOS platform, both Intel x86_64 and Apple M1 included.\n  3. Support LLVM Clang/Apple Clang/GCC compilers.\n* Photon 0.3 was released on 2 Sep 2022. Except for bug fixes and improvements, a new `photon_std` namespace is added.\n  Developers can search for `std::thread`, `std::mutex` in their own projects, and replace them all into the equivalents of `photon_std::\u003cxxx\u003e`.\n  It's a quick way to transform thread-based programs to coroutine-based ones.\n* Photon 0.2 was released on 28 Jul 2022. This release was mainly focused on network socket, security context and multi-vcpu support.\n  We re-worked the `WorkPool` so it's more friendly now to write multi-vcpu programs.\n* Made the first tag on 27 Jul 2022. Fix the compatibility for ARM CPU. Throughly compared the TCP echo server performance with other libs.\n\n\u003c/p\u003e\u003c/details\u003e\n\n## Introduction\nPhoton is a C++ library designed to augment the operating system in terms of\nhigh-performance concurrent I/O programming. Photon is collected from Alibaba\nCloud Storage team's internal code base. It has been extensively tested and\nused in production, and is the same code they depend on in their daily lives.\n\nPhoton features a highly efficient user-space threading model, implemented as\ncoroutines with multi-core CPU support, driven by a variety of asynchronous\nevent engines such as ```epoll```, ```io_uring```, and ```kqueue```, etc.\nThese event engines are abstracted behind a lightweight, unified interface.\n\nBuilt on this foundation, Photon provides a comprehensive set of high-level\nabstractions for networking and file I/O operations, leveraging both kernel-based\nsystem calls and high-performance user-space frameworks like DPDK and SPDK.\n\nFurthermore, Photon includes entirely new, ground-up implementations of key\ndistributed system components, including RPC, HTTP client and server, and\nRedis client, etc., delivering significantly higher performance and efficiency\ncompared to existing solutions. The architecture of Photon is illustrated below:\n\n\u003cimg src=\"doc/static/img/photon.png\" alt=\"Photon Architecture\" width=\"100%\"/\u003e\n\nPhoton is well-suited for developing any I/O-intensive applications,\nincluding those involving disk I/O and/or network I/O.\n\n* **Performance** Photon can switch to a thread in just a few nanoseconds;\n  this action corresponds to callback in a typical asynchronous framework.\n  The cost of creating a new thread is primarily a simple malloc(),\n  and the allocation can be pooled for even greater efficiency.\n  Performance benchmarks on I/O workloads are available\n  [here](https://photonlibos.github.io/docs/category/performance).\n\n* **Production** Photon is the foundation of many production systems in\n  (listing in alphabetical order)\n  [Alibaba Group](https://www.alibabagroup.com/en-US),\n  [Ant Group](https://www.antgroup.com/en),\n  [ByteDance](https://www.bytedance.com/en/),\n  [Xiaomi](https://www.mi.com/global/),\n  [XSKY](https://www.xsky.com/en/),\n  etc., and many open source projects in public domain.\n\n  * [overlaybd](https://github.com/containerd/overlaybd),\n  a sub-project of [containerd](https://containerd.io/), which is deployed\n  at scale in Alibaba's own infrastructure as well as the public cloud platform.\n\n  * [OSSFSv2](https://www.alibabacloud.com/help/en/oss/developer-reference/ossfs-2-0/),\n  a high-performance client for Alibaba Cloud's object storage service (OSS)\n  that provides a POSIX-compliant file system interface to the users.\n\n  * [Connector for AI/ML](https://github.com/aliyun/oss-connector-for-ai-ml),\n  a high-performance storage driver for popular AI frameworks, such as\n  Pythorch, safetensors, vllm, etc., supporting dataset reading, checkpointing,\n  model loading.\n\n  * [P2P Transport](https://www.alibabacloud.com/help/en/acr/use-the-p2p-acceleration-feature-in-ask-and-ack-clusters),\n  a key component that addresses the scalability issue of large scale data\n  serving, which is found in many scenarios like container image service, or\n  AI model loading, etc.\n\n  * Caching services, such as [OSS Accelerator](https://www.alibabacloud.com/help/en/oss/overview-77/),\n  a multi-tenant distributed caching service for high-performance object access;\n  or [EFC cache](https://www.alibabacloud.com/help/en/nas/user-guide/enable-the-distributed-caching-feature-of-the-cnfs-client),\n  a client-side caching module for elastic file client (EFC).\n\n  * [KTransformers](https://kvcache-ai.github.io/ktransformers/),\n  a flexible, Python-centric AI framework with advanced kernel optimizations\n  and placement/parallelism strategies, designed with extensibility at its core.\n  Photon is [used](https://github.com/alibaba/PhotonLibOS/issues/642) to\n  asynchronously load kvcache data from disk to memory, or vice versa.\n\n  * [The coroutine engine in VLang](https://github.com/vlang/v/blob/bfee8248603cfbe4022de8364260133f90d1783b/vlib/coroutines/README.md)\n\n* **Agility** Photon is designed to support a wide range of applications —\n  and is already deployed in production across diverse environments. We’ve\n  gone beyond mere feasibility, engineering it to be not only highly adaptable,\n  but also intuitive, convenient, and fast to use. This is made possible\n  through a set of well-defined, modular abstractions that decouple core\n  logic from underlying system specifics, enabling both flexibility and\n  performance.\n\n* **Portability** Photon supports multiple platforms, i.e. the\n  combinations of {Linux, macOS} * {x86_64, ARM64} * {gcc, clang}.\n\n* **Inclusion** in [awesome-cpp](https://github.com/fffaraz/awesome-cpp)\n\n## Community\n\n\u003cimg src=\"/doc/static/img/slack.svg\" width=\"20\"\u003e Join Slack: [link](https://join.slack.com/t/photonlibos/shared_invite/zt-25wauq8g1-iK_oHMrXetcvWNNhIt8Nkg)\n\n\u003cimg src=\"/doc/static/img/dingtalk.svg\" width=\"20\"\u003e Join DingTalk group: 55690000272\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falibaba%2Fphotonlibos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falibaba%2Fphotonlibos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falibaba%2Fphotonlibos/lists"}