View Issue Details

IDProjectCategoryView StatusLast Update
5835Composrcorepublic2024-08-03 22:20
ReporterChris Graham Assigned ToGuest  
PrioritynormalSeverityfeature 
Status newResolutionopen 
Summary5835: Parallel block generation using Fibers (holding issue)
DescriptionPHP Fibers (PHP 8.1+) are very interesting, and AMPHP is a very nice framework built on them:
https://github.com/amphp

The theory is we could build blocks in parallel. As soon as a block does something that would be blocking, like calling a URL or doing a query, it would let that run async and yield back to the block generation loop to start the next block. It would then wait for all blocks to finish generating.

Unfortunately the tech isn't quite there yet, and it's not as simple as it sounds. Most blocking comes from MySQL, but for parallel/async MySQL we would need to have multiple MySQL connections per process, which would itself be questionable in terms of performance (risk of any single request using too many resources, and too much time just initiating all these connections).

I don't think anything is actionable right now, but I wanted this on the tracker for further review and discussion.
TagsType: Performance
Attach Tags
Time estimation (hours)
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Relationships

related to 5836 Not AssignedGuest API-first development 

Activities

Chris Graham

2024-08-03 22:14

administrator   ~9065

Beyond AMPHP, there is also ReactPHP, Swoole and Hyperf. AMPHP seems most relevant though.
Another complexity is right now to use AMPHP we'd have to plug in its modules to replace core querying and HTTP functionality in relevant cases, which would complicate things, be a lot of work, and potentially hurt performance in different ways.

Add Note

View Status
Note
Upload Files
Maximum size: 32,768 KiB

Attach files by dragging & dropping, selecting or pasting them.
You are not logged in You are not logged in. This means you will not get any e-mail notifications. And if you reply, we will not know for sure you are the original poster of the issue.

Issue History

Date Modified Username Field Change
2024-08-03 22:12 Chris Graham New Issue
2024-08-03 22:12 Chris Graham Tag Attached: Type: Performance
2024-08-03 22:14 Chris Graham Note Added: 0009065
2024-08-03 22:20 Chris Graham Relationship added related to 5836