php / php/php-src

[RFC] True native async implementations

未关闭
#22,197 16 条评论 24 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Feature Status: Requires RFC
主要语言
C
星标
40.4k
派生
8.1k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Highlights

🏅 Top 1 performance in synthetic benchmark
30,000% faster latency in Laravel

RFC: https://wiki.php.net/rfc/true_async
Source: https://github.com/true-async/php-src/tree/true-async-stable

True Async Author: @EdmondDantes

Interests

There is also quite a bit of interest in true async as the exchanges here https://externals.io/message/129690#129944 and here https://github.com/orgs/true-async/discussions/9

Description

It was demonstrated that PHP-based framework can beat many frameworks with async, see here:

Image

https://www.http-arena.com/leaderboard/#v=composite&res=mem

It should be noted in the past, during techempower benchmark, actix is among the top contenders in web performance, but in httparena, php async framework scored higher with async/coroutine. While php is not entirely a framework, native async/coroutine is a promising potential

In other works, it also demonstrated massive performance improvement in average latency in Laravel from 4000 ms to 13ms for the same workload.

Image
Misconceptions
  • Myth 1

    Myth: Native async will mess up ALL of existing synchronous PHP code and projects globally!

    Truth: Actually no, you have to explicitly define a function/class/namespace to have an async property, otherwise all synchronous codes and projects will happily run as usual as if there is no native async.

  • Myth 2

    Myth: Great, now I have to think async when coding new project

    Truth: Actually no, just DON'T define your functions/class/namespace as async then you will be happy with your old php self

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从链接的 PHP RFC 和 true-async-stable 源代码分支开始,然后查看所引用的讨论和基准测试背景。该 issue 没有定义具体的文件、测试、实现边界或验收标准,因此要完成它,首先需要就设计和范围达成一致。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, php
领域
backend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
20/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。