View Issue Details

IDProjectCategoryView StatusLast Update
0005835Composrcorepublic2024-08-03 22:20
ReporterChris GrahamAssigned To 
SeverityFeature-request 
Status non-assignedResolutionopen 
Product Version 
Fixed in Version 
Summary0005835: 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
Time estimation (hours)
Sponsorship open

Relationships

related to 0005836 non-assigned API-first development 

Activities

Chris Graham

2024-08-03 22:14

administrator   ~0009065

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.

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 0005836