1586 Commits (e8903746e87ae2424ec82f3300e6c337b97ee464)

Author SHA1 Message Date
rubenrua 4e1887a721 Improve memory usage resolving dependencies
It is known that composer update takes a lot of memory: #5915, #5902,

I am playing with a profiler (@blackfireio) to make a demo in my local
PHP meetup (@phpvigo) and I found out a way to use less memory. These
are my first tests:

* Private project using PHP 5.6:
  * Memory: from 1.31GB to 1.07GB
  * Wall Time: from 2min 8s to 1min 33s

* symfony-demo using PHP 7.1 in my old mac book:
  * Memory: from 667MB to 523MB
  * Wall Time: from  5min 29s to 5min 28s

Not use an array inside conflict rules is this improvement main idea:

```php
<?php
//Memory 38MB
gc_collect_cycles();
gc_disable();

class Rule
{
    public $literals;

    public function __construct(array $literals)
    {
        $this->literals = $literals;
    }
}

$rules = array();

$i = 0;
while ($i<80000){ //
    $i++;

    $array = array(-$i, $i);
    $rule = new Rule($array);
    $rules[] = $rule;
}
```

```php
<?php
//Memory 11.1MB
gc_collect_cycles();
gc_disable();

class Rule2Literals
{
    public $literal1;
    public $literal2;

    public function __construct($literal1, $literal2)
    {
        $this->literal1 = $literal1;
        $this->literal2 = $literal2;
    }
}

$rules = array();

$i = 0;
while ($i<80000){ //
    $i++;

    $rule = new ConflictRule(-$i, $i);
    $rules[] = $rule;
}
```

More info https://github.com/composer/composer/pull/6168
7 years ago
Jordi Boggiano 20c16f18f5 Merge branch '1.3' 8 years ago
Jordi Boggiano f3d0e4660d Fix urlencoding of gitlab dots, fixes #6064 8 years ago
jbixler dac51c7f4b Add ignore filters option to archive command 8 years ago
Christophe Coevoet 1cb0ec7911 Resolve references in ComposerSchemaTest 8 years ago
johnstevenson 2b8ad7dc2a Clear xdebug version if restart fails, fixes #5995 8 years ago
Jordi Boggiano 2782d37a15 Merge pull request #5992 from AnrDaemon/fix-git-skips-proper
Properly skip GitDownloaderTest if git is not available
8 years ago
AnrDaemon 1d2a949e3e Properly fix git excludes.
Mindless copy-paste never gets old. Sorry. This is fixed proper this time.
8 years ago
AnrDaemon 810e70d234 Fix __DIR__/getcwd() inconsistency. 8 years ago
Jordi Boggiano df5fd3ba09 Cache executable finder calls 8 years ago
AnrDaemon ab70601700 Skip git-related tests if no git found. 8 years ago
johnstevenson 3928f1f3be Set xdebug version in environment, fixes #5967 8 years ago
Jordi Boggiano a1b468ea50 Fix git shortening, it is sunday.. 8 years ago
Jordi Boggiano 98c5f825e0 Fix tests and regression in @ref script handling 8 years ago
Jordi Boggiano 4d77ffcb4a Merge branch 'simplify-output' 8 years ago
Jordi Boggiano 4d082f77b8 Simplify composer output to take less lines 8 years ago
Jordi Boggiano e54c7478ee Attempt at fixing support for git 2.11, refs #5942 8 years ago
Jordi Boggiano 1dcb2b5758 Merge remote-tracking branch 'nicolas-grekas/apcu' 8 years ago
Jordi Boggiano e9d04f2b2d Merge branch '1.2' 8 years ago
Hans-Joachim Michl 817b2747c7 Fix #5672
This fixes the issue reported in #5672.
It just makes sure the ZendGuard encoded files can be autoloaded correctly.
8 years ago
Dries Vints 2ab7df5566 Do not add newlines to output 8 years ago
Nicolas Grekas 6d4e60b991 Add --apcu-autoloader option to enable APCu caching of found/not-found classes 8 years ago
Jordi Boggiano f3f063e3e2 Merge pull request #5888 from alcohol/array-default
use array as default value
8 years ago
Rob Bast 873f17261c
try to fix test instead of guarding implementation 8 years ago
Jordi Boggiano 8a2f597db3 Fix tests 8 years ago
Jordi Boggiano 91e7372c6e Backport update packagist default repo to be packagist.org 8 years ago
johnstevenson c1058cf37c Fix XdebugHandler test 8 years ago
johnstevenson 379fb70ad9 Use random name for tmp ini and delete after use
Thanks to Patrick Rose for reporting this issue.
8 years ago
Jordi Boggiano 8ad6385ffb Merge remote-tracking branch 'fabpot/more-debug' 8 years ago
Jordi Boggiano 43903a3979 Merge branch '1.2' 8 years ago
Jordi Boggiano 98a599d6c3 Merge pull request #5843 from stof/enforce_map_types
Enhance the json schema with validation for map objects
8 years ago
Jordi Boggiano 9801d831ed Merge pull request #5852 from fabpot/io-fix
Remove usage of echo when executing Composer script
8 years ago
Jordi Boggiano d6499b7c4a Merge pull request #5748 from kassner/hgdriver-bitbucket
HgDriver does not identify bitbucket mercurial repos correctly
8 years ago
Fabien Potencier 103624d4ed Remove usage of echo when executing Composer script 8 years ago
Christophe Coevoet 1882f9a502 Enhance the json schema with validation for map objects 8 years ago
Jordi Boggiano 208086d8e3 Merge remote-tracking branch 'channelgrabber/GitSpeedIncrease' 8 years ago
Jordi Boggiano adee0ff132 Fix tests 8 years ago
Jordi Boggiano e38ebefc7e Update packagist default repo to be packagist.org 8 years ago
Fabien Potencier 57ec0d1815 added more information in the output 8 years ago
Richard Heelin c2f6c61f56 Updated the tests to match the new command that is executed 8 years ago
Jordi Boggiano d9328ed5ae Merge pull request #5753 from alcohol/use-rfc3339-in-arraydumper
bring arraydumper in line with json schema spec and packagist
8 years ago
Konstantin.Myakshin dc70b40d34 Use implode instead of join 8 years ago
Jordi Boggiano d1867d5859 Merge branch '1.2' 8 years ago
Jordi Boggiano 5ee22f25ba Rework JSON matching to use a properly recursive pattern, fixes #5771 8 years ago
Jordi Boggiano 092dec9596 Add failing test for #5771 8 years ago
Jordi Boggiano 183398fe5e Merge pull request #5717 from berlinger-rarents/fix/5584_anon_redirect_bitbucket
prevent (prompt for) bitbucket auth when it redirected
8 years ago
Jordi Boggiano c540dace8c Merge pull request #5765 from fabpot/remove-obsolete-code
removed obsolete code
8 years ago
Jordi Boggiano 4cd6eabdba Merge branch '1.2' 8 years ago
Fabien Potencier 2853e82400 removed obsolete code 8 years ago
Christophe Coevoet d5810c8a36 Fix namespace for tests for consistency 8 years ago