php / php/php-src

[RFC] True native async implementations

Đang mở
#22,197 16 bình luận 24 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Feature Status: Requires RFC
Ngôn ngữ chính
C
Star
40.4k
Fork
8.2k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với PHP RFC được liên kết và nhánh mã nguồn true-async-stable, sau đó xem lại các cuộc thảo luận được tham chiếu và bối cảnh benchmark. Issue không xác định các tệp, bài kiểm thử, ranh giới triển khai hoặc tiêu chí chấp nhận cụ thể, vì vậy để hoàn thành sẽ cần thống nhất về thiết kế và phạm vi trước.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
c, php
Lĩnh vực
backend
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.