WordPress / WordPress/Requests
performance issue when using request_multiple
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 500
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 5
Description
The following code will cause serious performance problem:
do {
$status = curl_multi_exec($multihandle, $active);
}
while ($status === CURLM_CALL_MULTI_PERFORM);
it will be much better if changed as follow
do {
$status = curl_multi_exec($multihandle, $active);
usleep(1000);
}
while ($status === CURLM_CALL_MULTI_PERFORM);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the request_multiple implementation and the loop that calls curl_multi_exec; start by tracing how its status and active-handle values are handled. Compare the reported loop with the proposed delay, then verify that repeated multi requests no longer busy-wait while completing successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100