Parallel downloader#5293
Conversation
porting from hirak/prestissimo
|
|
||
| public static function generateUserAgent() | ||
| { | ||
| static $ua; |
There was a problem hiding this comment.
Are all this caches really required?
There was a problem hiding this comment.
Looks like some mirco ootimizing
There was a problem hiding this comment.
Because User-Agent is never-changed string in Composer process. But it was off the subject(parallel downloading).
Should I remove it for simplicity ?
There was a problem hiding this comment.
If it doesnt improve by a measurable amount of time I would drop it
|
Any numbers how much faster downloading gets with this PR? |
| /** @var resource<stream<plainfile>> */ | ||
| protected $fp; | ||
|
|
||
| protected $success = false; |
There was a problem hiding this comment.
I suggest using private visibility for all of them. It makes maintaining backward compatibility much easier (as anything private is outside the surface concerned with BC, while protected stuff is inside it due to inheritance)
|
@staabm It is a difficult question. Because it depends geolocation, composer command, etc.. For example, I benchmarked by San Francisco
Singapore
Details below |
|
Test failure is not my fault. |
| private static function ifOr($str, $pre = '', $post = '') | ||
| { | ||
| if ($str) { | ||
| return "$pre$str$post"; |
There was a problem hiding this comment.
return $pre . $str . $post;|
I built composer.phar for trial. |
| if ($this->user) { | ||
| $user = $this->user; | ||
| $user .= self::ifOr($this->pass, ':'); | ||
| $url .= "$user@"; |
| $this->permanent = $permanent; | ||
|
|
||
| // for PHP<5.5 @see getFinishedResults() | ||
| $this->blackhole = fopen('php://memory', 'wb'); |
There was a problem hiding this comment.
$this->blackhole = tmpfile(); or $this->blackhole = fopen('php://temp', 'wb');
I think 'php://temp' is better.
http://stackoverflow.com/questions/6841854/how-to-do-curl-put-requests-with-a-php-memory-file-handle
| } | ||
| } while ($remains > 0); | ||
|
|
||
| return compact('successCnt', 'failureCnt', 'urls'); |
There was a problem hiding this comment.
compact is not opimizable by php runtimes, better use the longer and more explicit form
|
|
|
Any news on this? |
|
@hirak Updates? |
|
@Seldaek are there any Planes to merge this? I Install this Plugin in every Environment we Develop or deploy and IT Speeds Up our deployment process 50% |
|
This will help a lot. |
|
Please merge. We're seeing major gains with parallel composer install/update. |
|
Any news about this issue? |
|
Hope you guys give a look for this pull, its been months I'm waiting this feature |
|
Still waiting for it :( |
|
please stop spamming this topic with useless comments. jordi is aware that a lot of people would love this feature, but it is not top priority. everybody can use the plugin in the meantime. |
|
Closed by #7904 which adds curl-multi support for the upcoming 2.0 |
Parallel Prefetcher
porting from https://github.com/hirak/prestissimo
Composer\Installer::doInstall()Composer\Util\RemoteFilesystem.repository.jsondownload in serial!extension_loaded('curl'), then fallback to RemoteFilesystemSee also
#2696
#3930 (comment)
Question
github-token,gitlab-tokenoptions are still alive?composer/src/Composer/Util/RemoteFilesystem.php
Line 235 in 36665d7
composer/src/Composer/Util/RemoteFilesystem.php
Line 240 in 36665d7
I can't find any documentation about that options. In this P-R, I didn't implement it yet.